Search in sources :

Example 1 with ShowCreateTable

use of io.crate.sql.tree.ShowCreateTable in project crate by crate.

the class TestStatementBuilder method testShowCreateTable.

@Test
public void testShowCreateTable() {
    Statement stmt = SqlParser.createStatement("SHOW CREATE TABLE foo");
    assertTrue(stmt instanceof ShowCreateTable);
    assertEquals(((ShowCreateTable) stmt).table().getName().toString(), "foo");
    stmt = SqlParser.createStatement("SHOW CREATE TABLE my_schema.foo");
    assertEquals(((ShowCreateTable) stmt).table().getName().toString(), "my_schema.foo");
}
Also used : SetStatement(io.crate.sql.tree.SetStatement) CommitStatement(io.crate.sql.tree.CommitStatement) DeallocateStatement(io.crate.sql.tree.DeallocateStatement) BeginStatement(io.crate.sql.tree.BeginStatement) Statement(io.crate.sql.tree.Statement) KillStatement(io.crate.sql.tree.KillStatement) SetSessionAuthorizationStatement(io.crate.sql.tree.SetSessionAuthorizationStatement) ShowCreateTable(io.crate.sql.tree.ShowCreateTable) Test(org.junit.Test)

Aggregations

BeginStatement (io.crate.sql.tree.BeginStatement)1 CommitStatement (io.crate.sql.tree.CommitStatement)1 DeallocateStatement (io.crate.sql.tree.DeallocateStatement)1 KillStatement (io.crate.sql.tree.KillStatement)1 SetSessionAuthorizationStatement (io.crate.sql.tree.SetSessionAuthorizationStatement)1 SetStatement (io.crate.sql.tree.SetStatement)1 ShowCreateTable (io.crate.sql.tree.ShowCreateTable)1 Statement (io.crate.sql.tree.Statement)1 Test (org.junit.Test)1