Was this page helpful?
ScyllaDB Java Driver is available under the Apache v2 License. ScyllaDB Java Driver is a fork of DataStax Java Driver. See Copyright here.
To create a TRUNCATE query, use one of the truncate
methods in QueryBuilder. There are several
variants depending on whether your table name is qualified, and whether you use
identifiers or raw strings:
import static com.datastax.oss.driver.api.querybuilder.QueryBuilder.*;
Truncate truncate = truncate("ks", "mytable");
// TRUNCATE ks.mytable
Truncate truncate2 = truncate(CqlIdentifier.fromCql("mytable"));
// TRUNCATE mytable
Note that, at this stage, the query is ready to build. After creating a TRUNCATE query it does not take any values.
Was this page helpful?
ScyllaDB Java Driver is available under the Apache v2 License. ScyllaDB Java Driver is a fork of DataStax Java Driver. See Copyright here.