Search in sources :

Example 1 with FullQuery

use of com.palantir.atlasdb.keyvalue.dbkvs.impl.FullQuery in project atlasdb by palantir.

the class RangePredicateHelperTest method endRowExclusiveReverse.

@Test
public void endRowExclusiveReverse() {
    FullQuery.Builder builder = FullQuery.builder();
    RangePredicateHelper.create(true, DBType.ORACLE, builder).endRowExclusive(ROW_NAME);
    FullQuery query = builder.build();
    assertThat(query.getQuery(), equalTo(" AND row_name > ? "));
    assertThat(query.getArgs(), arrayContaining((Object) ROW_NAME));
}
Also used : FullQuery(com.palantir.atlasdb.keyvalue.dbkvs.impl.FullQuery) Test(org.junit.Test)

Example 2 with FullQuery

use of com.palantir.atlasdb.keyvalue.dbkvs.impl.FullQuery in project atlasdb by palantir.

the class RangePredicateHelperTest method startCellTsInclusiveForwardPostgres.

@Test
public void startCellTsInclusiveForwardPostgres() {
    FullQuery.Builder builder = FullQuery.builder();
    RangePredicateHelper.create(false, DBType.POSTGRESQL, builder).startCellTsInclusive(ROW_NAME, COL_NAME, TS);
    FullQuery query = builder.build();
    assertThat(query.getQuery(), equalTo(" AND (row_name, col_name, ts) >= (?, ?, ?)"));
    assertThat(query.getArgs(), arrayContaining(ROW_NAME, COL_NAME, TS));
}
Also used : FullQuery(com.palantir.atlasdb.keyvalue.dbkvs.impl.FullQuery) Test(org.junit.Test)

Example 3 with FullQuery

use of com.palantir.atlasdb.keyvalue.dbkvs.impl.FullQuery in project atlasdb by palantir.

the class RangePredicateHelperTest method startCellTsInclusiveReversePostgres.

@Test
public void startCellTsInclusiveReversePostgres() {
    FullQuery.Builder builder = FullQuery.builder();
    RangePredicateHelper.create(true, DBType.POSTGRESQL, builder).startCellTsInclusive(ROW_NAME, COL_NAME, TS);
    FullQuery query = builder.build();
    assertThat(query.getQuery(), equalTo(" AND (row_name, col_name, ts) <= (?, ?, ?)"));
    assertThat(query.getArgs(), arrayContaining(ROW_NAME, COL_NAME, TS));
}
Also used : FullQuery(com.palantir.atlasdb.keyvalue.dbkvs.impl.FullQuery) Test(org.junit.Test)

Example 4 with FullQuery

use of com.palantir.atlasdb.keyvalue.dbkvs.impl.FullQuery in project atlasdb by palantir.

the class RangePredicateHelperTest method columnSelectionEmpty.

@Test
public void columnSelectionEmpty() {
    FullQuery.Builder builder = FullQuery.builder();
    RangePredicateHelper.create(false, DBType.ORACLE, builder).columnSelection(ImmutableList.of());
    FullQuery query = builder.build();
    assertThat(query.getQuery(), isEmptyString());
    assertThat(query.getArgs(), emptyArray());
}
Also used : FullQuery(com.palantir.atlasdb.keyvalue.dbkvs.impl.FullQuery) Test(org.junit.Test)

Example 5 with FullQuery

use of com.palantir.atlasdb.keyvalue.dbkvs.impl.FullQuery in project atlasdb by palantir.

the class RangePredicateHelperTest method startRowInclusiveForward.

@Test
public void startRowInclusiveForward() {
    FullQuery.Builder builder = FullQuery.builder();
    RangePredicateHelper.create(false, DBType.ORACLE, builder).startRowInclusive(ROW_NAME);
    FullQuery query = builder.build();
    assertThat(query.getQuery(), equalTo(" AND row_name >= ? "));
    assertThat(query.getArgs(), arrayContaining((Object) ROW_NAME));
}
Also used : FullQuery(com.palantir.atlasdb.keyvalue.dbkvs.impl.FullQuery) Test(org.junit.Test)

Aggregations

FullQuery (com.palantir.atlasdb.keyvalue.dbkvs.impl.FullQuery)45 Test (org.junit.Test)18 AgnosticLightResultRow (com.palantir.nexus.db.sql.AgnosticLightResultRow)1