Saurav Haloi
Saurav Haloi

Reputation: 343

column names of Cassandra tables using libcql

Is there a way to get the column names of a table in Cassandra with libcql (https://github.com/datastax/cpp-driver)? I could not find a relevent API calls in the C++ driver.

Any help is highly appreciated.

Regards, Saurav

Upvotes: 1

Views: 256

Answers (1)

Lyuben Todorov
Lyuben Todorov

Reputation: 14153

cqllib is CQL3 compliant so why not just query the system tables? The example on the page you linked actually shows how to retrieve information about the keyspaces in the cluster.

As for the columns, the queries you are after:

 SELECT * FROM system.schema_columns;
 // or specify a keyspace to make column retrieval more specific 
 SELECT * FROM schema_columns WHERE keyspace_name='ks_name';

Upvotes: 2

Related Questions