Tabnine Logo
SchemaBuilder.dropTable
Code IndexAdd Tabnine to your IDE (free)

How to use
dropTable
method
in
com.datastax.driver.core.schemabuilder.SchemaBuilder

Best Java code snippets using com.datastax.driver.core.schemabuilder.SchemaBuilder.dropTable (Showing top 20 results out of 315)

origin: hugegraph/hugegraph

public void dropTable(CassandraSessionPool.Session session) {
  session.execute(SchemaBuilder.dropTable(this.table).ifExists());
}
origin: com.datastax.cassandra/cassandra-driver-core

@Test(groups = "unit")
public void should_drop_table() throws Exception {
 // When
 SchemaStatement statement = dropTable("test");
 // Then
 assertThat(statement.getQueryString()).isEqualTo("DROP TABLE test");
}
origin: com.datastax.cassandra/cassandra-driver-core

@Test(
  groups = "unit",
  expectedExceptions = IllegalArgumentException.class,
  expectedExceptionsMessageRegExp =
    "The keyspace name 'add' is not allowed because it is a reserved keyword")
public void should_fail_if_keyspace_name_is_a_reserved_keyword() throws Exception {
 dropTable("add", "test").getQueryString();
}
origin: com.datastax.cassandra/cassandra-driver-core

@Test(groups = "unit")
public void should_drop_table_with_keyspace() throws Exception {
 // When
 SchemaStatement statement = dropTable("ks", "test");
 // Then
 assertThat(statement.getQueryString()).isEqualTo("DROP TABLE ks.test");
}
origin: com.datastax.cassandra/cassandra-driver-core

 @Test(
   groups = "unit",
   expectedExceptions = IllegalArgumentException.class,
   expectedExceptionsMessageRegExp =
     "The table name 'add' is not allowed because it is a reserved keyword")
 public void should_fail_if_table_name_is_a_reserved_keyword() throws Exception {
  dropTable("add").getQueryString();
 }
}
origin: hugegraph/hugegraph

protected void dropTable(CassandraSessionPool.Session session) {
  LOG.debug("Drop table: {}", this.table());
  session.execute(SchemaBuilder.dropTable(this.table()).ifExists());
}
origin: com.datastax.cassandra/cassandra-driver-core

@Test(groups = "unit")
public void should_drop_table_with_keyspace_if_exists() throws Exception {
 // When
 SchemaStatement statement = dropTable("ks", "test").ifExists();
 // Then
 assertThat(statement.getQueryString()).isEqualTo("DROP TABLE IF EXISTS ks.test");
}
origin: hugegraph/hugegraph

@Override
protected void dropTable(CassandraSessionPool.Session session) {
  session.execute(SchemaBuilder.dropTable(indexTable()).ifExists());
  super.dropTable(session);
}
origin: hugegraph/hugegraph

@Override
protected void dropTable(CassandraSessionPool.Session session) {
  session.execute(SchemaBuilder.dropTable(indexTable()).ifExists());
  super.dropTable(session);
}
origin: com.datastax.cassandra/cassandra-driver-core

@Test(groups = "short")
public void should_drop_a_table() {
 // Create a table
 session()
   .execute(
     SchemaBuilder.createTable("ks", "DropTable").addPartitionKey("a", DataType.cint()));
 // Drop the table
 session().execute(SchemaBuilder.dropTable("ks", "DropTable"));
 session().execute(SchemaBuilder.dropTable("DropTable").ifExists());
 ResultSet rows =
   session()
     .execute(
       "SELECT columnfamily_name "
         + "FROM system.schema_columnfamilies "
         + "WHERE keyspace_name='ks' AND columnfamily_name='droptable'");
 if (rows.iterator().hasNext()) {
  fail("This table should have been deleted");
 }
}
origin: com.datastax.dse/dse-java-driver-core

@Test(
  groups = "unit",
  expectedExceptions = IllegalArgumentException.class,
  expectedExceptionsMessageRegExp =
    "The keyspace name 'add' is not allowed because it is a reserved keyword")
public void should_fail_if_keyspace_name_is_a_reserved_keyword() throws Exception {
 dropTable("add", "test").getQueryString();
}
origin: com.datastax.dse/dse-java-driver-core

@Test(groups = "unit")
public void should_drop_table_with_keyspace() throws Exception {
 // When
 SchemaStatement statement = dropTable("ks", "test");
 // Then
 assertThat(statement.getQueryString()).isEqualTo("DROP TABLE ks.test");
}
origin: com.datastax.dse/dse-java-driver-core

 @Test(
   groups = "unit",
   expectedExceptions = IllegalArgumentException.class,
   expectedExceptionsMessageRegExp =
     "The table name 'add' is not allowed because it is a reserved keyword")
 public void should_fail_if_table_name_is_a_reserved_keyword() throws Exception {
  dropTable("add").getQueryString();
 }
}
origin: com.datastax.dse/dse-java-driver-core

@Test(groups = "unit")
public void should_drop_table() throws Exception {
 // When
 SchemaStatement statement = dropTable("test");
 // Then
 assertThat(statement.getQueryString()).isEqualTo("DROP TABLE test");
}
origin: com.datastax.dse/dse-java-driver-core

@Test(groups = "unit")
public void should_drop_table_with_keyspace_if_exists() throws Exception {
 // When
 SchemaStatement statement = dropTable("ks", "test").ifExists();
 // Then
 assertThat(statement.getQueryString()).isEqualTo("DROP TABLE IF EXISTS ks.test");
}
origin: com.baidu.hugegraph/hugegraph-scylladb

@Override
protected void dropTable(CassandraSessionPool.Session session) {
  session.execute(SchemaBuilder.dropTable(indexTable()).ifExists());
  super.dropTable(session);
}
origin: com.baidu.hugegraph/hugegraph-scylladb

@Override
protected void dropTable(CassandraSessionPool.Session session) {
  session.execute(SchemaBuilder.dropTable(indexTable()).ifExists());
  super.dropTable(session);
}
origin: apache/james-project

private static void cleanCassandra(Session session) {
  MODULE.moduleTables().forEach(table -> session.execute(SchemaBuilder.dropTable(table.getName())));
  MODULE.moduleTypes().forEach(type -> session.execute(SchemaBuilder.dropType(type.getName())));
}
origin: apache/james-project

@Test
void initializeTableShouldCreateAllTheTables() {
  cassandra.getConf().execute(SchemaBuilder.dropTable(TABLE_NAME));
  cassandra.getConf().execute(SchemaBuilder.dropTable(CassandraSchemaVersionTable.TABLE_NAME));
  assertThat(new CassandraTableManager(MODULE, cassandra.getConf()).initializeTables())
      .isEqualByComparingTo(CassandraTable.InitializationStatus.FULL);
  ensureTableExistence(TABLE_NAME);
}
origin: apache/james-project

@Test
void initializeTableShouldCreateAllTheMissingTable() {
  cassandra.getConf().execute(SchemaBuilder.dropTable(TABLE_NAME));
  assertThat(new CassandraTableManager(MODULE, cassandra.getConf()).initializeTables())
      .isEqualByComparingTo(CassandraTable.InitializationStatus.PARTIAL);
  ensureTableExistence(TABLE_NAME);
}
com.datastax.driver.core.schemabuilderSchemaBuilderdropTable

Javadoc

Start building a new DROP TABLE statement.

Popular methods of SchemaBuilder

  • createTable
    Start building a new CREATE TABLE statement.
  • createKeyspace
    Start building a new CREATE KEYSPACE statement.
  • dropKeyspace
    Start building a new DROP KEYSPACE statement.
  • leveledStrategy
    Create options for the leveled compaction strategy, to use in a CREATE or ALTER TABLE statement.
  • lz4
    Create options for the LZ4 compression strategy, to use in a CREATE or ALTER TABLE statement.
  • sizedTieredStategy
    Create options for the size-tiered compaction strategy, for use in a CREATE or ALTER TABLE statement
  • createType
    Start building a new CREATE TYPE statement.
  • noSpeculativeRetry
    Create the speculative retry strategy that never retries reads, to use in a CREATE or ALTER TABLE st
  • createIndex
    Start building a new CREATE INDEX statement.
  • dateTieredStrategy
    Create options for the date-tiered compaction strategy, to use in a CREATE or ALTER TABLE statement.
  • deflate
    Create options for the Deflate compression strategy, to use in a CREATE or ALTER TABLE statement.
  • dropType
    Start building a new DROP TYPE statement.
  • deflate,
  • dropType,
  • noCompression,
  • snappy,
  • allRows,
  • alterKeyspace,
  • alterTable,
  • always,
  • dropIndex

Popular in Java

  • Finding current android device location
  • getSupportFragmentManager (FragmentActivity)
  • setRequestProperty (URLConnection)
  • getSharedPreferences (Context)
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • Notification (javax.management)
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now