Search in sources :

Example 1 with CreateLinkedTable

use of org.h2.command.ddl.CreateLinkedTable in project h2database by h2database.

the class Parser method parseCreateLinkedTable.

private CreateLinkedTable parseCreateLinkedTable(boolean temp, boolean globalTemp, boolean force) {
    read("TABLE");
    boolean ifNotExists = readIfNotExists();
    String tableName = readIdentifierWithSchema();
    CreateLinkedTable command = new CreateLinkedTable(session, getSchema());
    command.setTemporary(temp);
    command.setGlobalTemporary(globalTemp);
    command.setForce(force);
    command.setIfNotExists(ifNotExists);
    command.setTableName(tableName);
    command.setComment(readCommentIf());
    read("(");
    command.setDriver(readString());
    read(",");
    command.setUrl(readString());
    read(",");
    command.setUser(readString());
    read(",");
    command.setPassword(readString());
    read(",");
    String originalTable = readString();
    if (readIf(",")) {
        command.setOriginalSchema(originalTable);
        originalTable = readString();
    }
    command.setOriginalTable(originalTable);
    read(")");
    if (readIf("EMIT")) {
        read("UPDATES");
        command.setEmitUpdates(true);
    } else if (readIf("READONLY")) {
        command.setReadOnly(true);
    }
    return command;
}
Also used : CreateLinkedTable(org.h2.command.ddl.CreateLinkedTable) ValueString(org.h2.value.ValueString)

Aggregations

CreateLinkedTable (org.h2.command.ddl.CreateLinkedTable)1 ValueString (org.h2.value.ValueString)1