Examples of indexColumn()


Examples of com.foundationdb.ais.model.AISBuilder.indexColumn()

        AkibanInformationSchema ais = aisCloner().clone(ddl().getAIS(session()));
        Table table = ais.getTable(SCHEMA, "c");
        table.removeIndexes(Collections.singleton(table.getIndex("foo")));
        AISBuilder builder = new AISBuilder(ais);
        builder.index(SCHEMA, "c", "foo");
        builder.indexColumn(SCHEMA, "c", "foo", "c2", 0, true, null);

        List<TableChange> changes = new ArrayList<>();
        changes.add(TableChange.createDrop("foo"));
        changes.add(TableChange.createAdd("foo"));
View Full Code Here

Examples of com.foundationdb.ais.model.AISBuilder.indexColumn()

        AkibanInformationSchema ais = aisCloner().clone(ddl().getAIS(session()));
        Table table = ais.getTable(SCHEMA, "c");
        table.removeIndexes(Collections.singleton(table.getIndex("foo")));
        AISBuilder builder = new AISBuilder(ais);
        builder.index(SCHEMA, "c", "foo");
        builder.indexColumn(SCHEMA, "c", "foo", "c2", 0, true, null);
        builder.indexColumn(SCHEMA, "c", "foo", "c1", 1, true, null);

        List<TableChange> changes = new ArrayList<>();
        changes.add(TableChange.createModify("foo", "foo"));
View Full Code Here

Examples of com.foundationdb.ais.model.AISBuilder.indexColumn()

        Table table = ais.getTable(SCHEMA, "c");
        table.removeIndexes(Collections.singleton(table.getIndex("foo")));
        AISBuilder builder = new AISBuilder(ais);
        builder.index(SCHEMA, "c", "foo");
        builder.indexColumn(SCHEMA, "c", "foo", "c2", 0, true, null);
        builder.indexColumn(SCHEMA, "c", "foo", "c1", 1, true, null);

        List<TableChange> changes = new ArrayList<>();
        changes.add(TableChange.createModify("foo", "foo"));

        ddl().alterTable(session(), new TableName(SCHEMA, "c"), table, NO_CHANGES, changes, queryContext());
View Full Code Here

Examples of com.foundationdb.ais.model.AISBuilder.indexColumn()

    @Test
    public void dropUniqueMiddleOfGroup() throws StandardException {
        buildCOIJoinedAUnJoined();
        AISBuilder builder2 = new AISBuilder(builder.unvalidatedAIS());
        builder2.unique(SCHEMA, "o", "x");
        builder2.indexColumn(SCHEMA, "o", "x", "o_o", 0, true, null);
        parseAndRun("ALTER TABLE o DROP UNIQUE x");
        expectColumnChanges();
        expectIndexChanges("DROP:x");
        expectFinalTable(O_NAME, "id MCOMPAT_ BIGINT(21) NOT NULL", "cid MCOMPAT_ BIGINT(21) NULL", "o_o MCOMPAT_ BIGINT(21) NULL",
                         "fk1(cid)", "PRIMARY(id)", "join(cid->id)");
View Full Code Here

Examples of com.foundationdb.ais.model.AISBuilder.indexColumn()

        builder.table("test", "t1");
        builder.column("test", "t1", "c1", 0, intType, false, null, null);
        builder.column("test", "t1", "x", 1, intType, false, null, null);
        builder.column("test", "t1", "y", 2, intType, false, null, null);
        builder.pk("test", "t1");
        builder.indexColumn("test", "t1", Index.PRIMARY, "c1", 0, true, null);
        builder.table("test", "t2");
        builder.column("test", "t2", "c1", 0, intType, false, null, null);
        builder.column("test", "t2", "c2", 1, intType, false, null, null);
        builder.column("test", "t2", "y", 2, intType, false, null, null);
        builder.basicSchemaIsComplete();
View Full Code Here

Examples of com.foundationdb.ais.model.AISBuilder.indexColumn()

        final Integer INDEXED_LENGTH = 16;
        AISBuilder builder = new AISBuilder();
        builder.table(SCHEMA, TABLE);
        builder.column(SCHEMA, TABLE, "v", 0, typesRegistry().getTypeClass("MCOMPAT", "VARCHAR").instance(32, false), false, null, null);
        builder.index(SCHEMA, TABLE, "v");
        builder.indexColumn(SCHEMA, TABLE, "v", "v", 0, true, INDEXED_LENGTH);
        builder.createGroup(TABLE, SCHEMA);
        builder.addTableToGroup(TABLE, SCHEMA, TABLE);
        builder.basicSchemaIsComplete();
        builder.groupingIsComplete();
View Full Code Here

Examples of com.foundationdb.ais.model.TestAISBuilder.indexColumn()

        builder.table("schema", "item");
        builder.column("schema", "item", "item_id", 0, "MCOMPAT", "int", false);
        builder.column("schema", "item", "order_id", 1, "MCOMPAT", "int", false);
        builder.column("schema", "item", "quantity", 2, "MCOMPAT", "int", false);
        builder.pk("schema", "item");
        builder.indexColumn("schema", "item", Index.PRIMARY, "item_id", 0, true, null);
        builder.joinTables("co", "schema", "customer", "schema", "order");
        builder.joinColumns("co", "schema", "customer", "customer_id", "schema", "order", "customer_id");
        builder.joinTables("oi", "schema", "order", "schema", "item");
        builder.joinColumns("oi", "schema", "order", "order_id", "schema", "item", "item_id");
        builder.table("schema", "state");
View Full Code Here

Examples of com.foundationdb.ais.model.TestAISBuilder.indexColumn()

        builder.table(SCHEMA, I_TABLE);
        builder.column(SCHEMA, I_TABLE, "id", 0, "MCOMPAT", "int", false);
        builder.column(SCHEMA, I_TABLE, "oid", 1, "MCOMPAT", "int", false);
        builder.column(SCHEMA, I_TABLE, "ii", 2, "MCOMPAT", "varchar", 5L, null, true);
        builder.pk(SCHEMA, I_TABLE);
        builder.indexColumn(SCHEMA, I_TABLE, Index.PRIMARY, "id", 0, true, null);
        builder.index(SCHEMA, I_TABLE, "oid");
        builder.indexColumn(SCHEMA, I_TABLE, "oid", "oid", 0, true, null);
        builder.index(SCHEMA, I_TABLE, "ii");
        builder.indexColumn(SCHEMA, I_TABLE, "ii", "ii", 0, true, null);
        builder.basicSchemaIsComplete();
View Full Code Here

Examples of com.foundationdb.ais.model.TestAISBuilder.indexColumn()

        builder.column(SCHEMA, I_TABLE, "oid", 1, "MCOMPAT", "int", false);
        builder.column(SCHEMA, I_TABLE, "ii", 2, "MCOMPAT", "varchar", 5L, null, true);
        builder.pk(SCHEMA, I_TABLE);
        builder.indexColumn(SCHEMA, I_TABLE, Index.PRIMARY, "id", 0, true, null);
        builder.index(SCHEMA, I_TABLE, "oid");
        builder.indexColumn(SCHEMA, I_TABLE, "oid", "oid", 0, true, null);
        builder.index(SCHEMA, I_TABLE, "ii");
        builder.indexColumn(SCHEMA, I_TABLE, "ii", "ii", 0, true, null);
        builder.basicSchemaIsComplete();
        builder.createGroup(O_TABLE, SCHEMA);
        builder.addTableToGroup(O_TABLE, SCHEMA, O_TABLE);
View Full Code Here

Examples of com.foundationdb.ais.model.TestAISBuilder.indexColumn()

        builder.pk(SCHEMA, I_TABLE);
        builder.indexColumn(SCHEMA, I_TABLE, Index.PRIMARY, "id", 0, true, null);
        builder.index(SCHEMA, I_TABLE, "oid");
        builder.indexColumn(SCHEMA, I_TABLE, "oid", "oid", 0, true, null);
        builder.index(SCHEMA, I_TABLE, "ii");
        builder.indexColumn(SCHEMA, I_TABLE, "ii", "ii", 0, true, null);
        builder.basicSchemaIsComplete();
        builder.createGroup(O_TABLE, SCHEMA);
        builder.addTableToGroup(O_TABLE, SCHEMA, O_TABLE);
        builder.joinTables("o/i", SCHEMA, O_TABLE, SCHEMA, I_TABLE);
        builder.joinColumns("o/i", SCHEMA, O_TABLE, "id", SCHEMA, I_TABLE, "oid");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.