DbSchema is a powerful database management and design tool for Cassandra. It offers features such as visual schema design, team collaboration with GIT, schema deployment and HTML schema documentation.
Choose "Connect to the database" or "New Model Connected to the Database" will let you select your database and open the Connection Dialog.
DbSchema automatically downloads the JDBC driver to connect to your database.
In the Connection Dialog window, select the JDBC URL you want to connect with. If your database is running in the cloud, choose Edit Manually and insert the JDBC URL from the cloud console.
Enter the host name, the authentication details, select your database as described in the Connection Dialog page.
The default DbSchema connection dialog shows an option to connect only to a single host. To connect to multiple hosts use the 'JDBC URL' tab and edit a string like here:
jdbc:cassandra://host1[:port1][,host2[:port2],...[,hostN[:portN]]][/[keyspace];[dataCenter][&options]]
Find the DataCenter using 'nodetool status' or 'nodetool -h ::FFFF:127.0.0.1 status'.
This will be translate an URL like jdbc:cassandra://192.168.0.1:9042/mykeyspace into:
Cluster cluster = Cluster.builder().addContactPoint("192.168.0.1").withPort(9042).build();
Session session = cluster.connect("mykeyspace");
-Djavax.net.ssl.trustStore=/path/to/client.truststore
-Djavax.net.ssl.trustStorePassword=password123
# If you're using client authentication:
-Djavax.net.ssl.keyStore=/path/to/client.keystore
-Djavax.net.ssl.keyStorePassword=password123
CREATE KEYSPACE sample
WITH REPLICATION = { 'class' : 'NetworkTopologyStrategy',
'datacenter1' : 3 } AND DURABLE_WRITES = false;
CREATE TABLE sample.table1 ( id int primary key, name text);
####################
CREATE TYPE sample.flagtype (data map<text,text>,working text);
CREATE TABLE sample.table1a (abc text,
hello text,
flag frozen<flagtype>,
PRIMARY KEY (abc));
INSERT INTO sample.table1a JSON '{"abc":"abc", "hello":"world", "flag":{"data":{"hi":"cassandra"}, "working":"no"}}';