Utilities for creating/navigating an in-memory represenatation of a Cassandra keyspace.
Notes: expect functions with match-X
prefix to mostly do matching (via core.match).
Functions without the match-X
prefix should return objects ready for use.
The CQL parser uses a slightly modified ANTLR grammar file available from
Utilities for creating/navigating an in-memory represenatation of a Cassandra keyspace. Notes: expect functions with `match-X` prefix to mostly do matching (via core.match). Functions without the `match-X` prefix should return objects ready for use. The CQL parser uses a slightly modified ANTLR grammar file available from https://github.com/antlr/grammars-v4/tree/master/cql3
Returns a vector of column names (strings)
Returns a vector of column names (strings)
(add-index schema-info)
Adds :index to schema-info
Adds :index to schema-info
(column-names definition)
Returns a vector of column names (strings)
Returns a vector of column names (strings)
(create-view form)
(deep-vectorize form)
clj-antlr uses cons list, we want to turn them into vectors because core.match's syntax for matching vectors is less verbose.
clj-antlr uses cons list, we want to turn them into vectors because core.match's syntax for matching vectors is less verbose.
(find-cql parsed kw)
Takes output of clj-antlr.core/parse
and collects all CLQ forms starting with given keyword.
Returns a seq.
kw
keyword, e.g. :createTable
Takes output of `clj-antlr.core/parse` and collects all CLQ forms starting with given keyword. Returns a seq. - `kw` keyword, e.g. `:createTable`
Finds occurences of tables or views in parser output.
Finds occurences of tables or views in parser output.
(-find-tables _ opts)
Returns a collection of :kasandra.schema/table
Returns a collection of `:kasandra.schema/table`
(-find-views _ opts)
Returns a collection of :kasandra.schema/materialized-view
Returns a collection of `:kasandra.schema/materialized-view`
(lookup-by-name schema-info name)
Given the schema info (which should include the index) get the table or view with that name or nil.
Given the schema info (which should include the index) get the table or view with that name or nil.
(make-primary-key partition-key clustering-key)
(match-column-definition form)
returns a tuple of [(:column | :pk | :pk-column) payload]
returns a tuple of [(:column | :pk | :pk-column) payload]
(match-create-table form)
Returns a map of shape: {::table ... ::keyspace ... ::columns []}
merged with keys returned by match-create-table-with
Returns a map of shape: {::table ... ::keyspace ... ::columns []} merged with keys returned by `match-create-table-with`
(match-create-table-clustering-key form)
Returns a vector of tuples like ["col-name" :asc]
Returns a vector of tuples like ["col-name" :asc]
(match-create-table-clustering-key-column form)
(match-create-table-option-item form)
(match-create-table-options form)
(match-create-table-with form)
Returns a map of shape: {::table-options ... ::clustering-key [[string kw]*]}
Returns a map of shape: {::table-options ... ::clustering-key [[string kw]*]}
(match-create-view form)
(match-option-hash-item form)
(match-primary-key form)
(match-view-clustering-order form)
(materialized-views provider parsed)
Returns a collection of materialized view defintions.
Returns a collection of materialized view defintions.
(primary-key-column-names table-or-view)
Returns a vector of column names comprising the primary key.
Returns a vector of column names comprising the primary key.
(schema-index schema-info)
Creates an index for easy look up of tables/views by name
Creates an index for easy look up of tables/views by name
(schema-info provider cql)
(schema-info provider cql options)
Returns a map containing :tables and :views. Supported options:
Returns a map containing :tables and :views. Supported options: - :index - set to :include and result map will contain :index entry with a map of name -> path that can be used to lookup the item in the schema info.
Parses DB schema and outputs something TableInfoProvider
and
ViewInfoProvider
can use.
Parses DB schema and outputs something `TableInfoProvider` and `ViewInfoProvider` can use.
(-parse self input)
(search-schema-info schema-info regex)
Returns a seq of tuples [name location] where location is a path to the item in passed schema-info.
Returns a seq of tuples [name location] where location is a path to the item in passed schema-info.
(syntax-comma? form)
Extracts table definition from parser output.
Extracts table definition from parser output.
(-tables this parsed)
Returns a collection of table definitions.
Returns a collection of table definitions.
(tables provider parsed)
Returns a collection of table definitions.
Returns a collection of table definitions.
Extracts materialized view definitions from parser output
Extracts materialized view definitions from parser output
(-views this parsed)
Returns a collection of view definitions
Returns a collection of view definitions
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close