use of org.folio.dbschema.Index in project raml-module-builder by folio-org.
the class IndexTest method sqlExpressionNotTruncated.
@Test
void sqlExpressionNotTruncated() {
Index idx = index("testIdx", "testIdx");
idx.setSqlExpression("concat_space_sql(a, b)");
assertEquals("concat_space_sql(a, b)", idx.getFinalTruncatedSqlExpression("test_table"));
}
use of org.folio.dbschema.Index in project raml-module-builder by folio-org.
the class IndexTest method indexStringTypeTrue.
@Test
void indexStringTypeTrue() {
Index idx = new Index();
idx.setFieldName("testField");
idx.setStringType(true);
idx.setupIndex();
assertEquals("left(lower(f_unaccent(jsonb->>'testField')),600)", idx.getFinalTruncatedSqlExpression("test_table"));
}
use of org.folio.dbschema.Index in project raml-module-builder by folio-org.
the class IndexTest method indexExpressionDotsInPath.
@Test
void indexExpressionDotsInPath() {
Index idx = index("testIdx", "dummy");
idx.setMultiFieldNames("blah.blah2.field1,blah.blah2.field2");
assertEquals("concat_space_sql(test_table.jsonb->'blah'->'blah2'->>'field1' , test_table.jsonb->'blah'->'blah2'->>'field2')", idx.getFinalSqlExpression("test_table"));
}
use of org.folio.dbschema.Index in project raml-module-builder by folio-org.
the class IndexTest method multiFieldNames.
@Test
void multiFieldNames() {
Index idx = index("testIdx", "testIdx");
idx.setMultiFieldNames("field1,field2,field3");
assertEquals("concat_space_sql(test_table.jsonb->>'field1' , test_table.jsonb->>'field2' , test_table.jsonb->>'field3')", idx.getFinalSqlExpression("test_table"));
}
use of org.folio.dbschema.Index in project raml-module-builder by folio-org.
the class IndexTest method fieldPath.
@Test
void fieldPath() {
Index idx = index("testIdx", "testIdx");
assertEquals("testIdx", idx.getFinalSqlExpression("test_table"));
}
Aggregations