Skip to content

Instantly share code, notes, and snippets.

@blokhin
Last active January 6, 2025 22:01
Show Gist options
  • Select an option

  • Save blokhin/a7a953aec38ef6265da252456bd31fb2 to your computer and use it in GitHub Desktop.

Select an option

Save blokhin/a7a953aec38ef6265da252456bd31fb2 to your computer and use it in GitHub Desktop.
CONSISTENCY ONE;
CREATE KEYSPACE james WITH replication = {'class':'SimpleStrategy', 'replication_factor': 1};
describe keyspaces;
describe tables;
use james;
CREATE TABLE james (column1 int PRIMARY KEY, column2 text);
INSERT INTO james (column1, column2) VALUES(42, 'just a test');
SELECT * FROM system_schema.keyspaces;
USE system;
SELECT * FROM system.peers;
select * from cosmopolitans_logs where stamp_id >= '2019-12-14 00:00:00+0000' allow filtering;
CREATE KEYSPACE test WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'};
ALTER KEYSPACE test WITH REPLICATION = {'class' : 'NetworkTopologyStrategy', 'dc1' : 3, 'dc2' : 2};
USE test;
CREATE TABLE users (name text, PRIMARY KEY (name));
INSERT INTO users (name) VALUES ('James');
SELECT * FROM users;
USE test;
SELECT * FROM users;
LIST USERS;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment