Liking cljdoc? Tell your friends :D

kasandra.schema

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

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
raw docstring

-column-namescljmultimethod

Returns a vector of column names (strings)

Returns a vector of column names (strings)
raw docstring

add-indexclj

(add-index schema-info)

Adds :index to schema-info

Adds :index to schema-info
raw docstring

CljAntlrOutputclj


column-namesclj

(column-names definition)

Returns a vector of column names (strings)

Returns a vector of column names (strings)
raw docstring

create-tableclj

(create-table form)

Returns

Returns
raw docstring

create-viewclj

(create-view form)

deep-vectorizeclj

(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.
raw docstring

find-cqlclj

(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`
raw docstring

FormFindercljprotocol

Finds occurences of tables or views in parser output.

Finds occurences of tables or views in parser output.

-find-tablesclj

(-find-tables _ opts)

Returns a collection of :kasandra.schema/table

Returns a collection of `:kasandra.schema/table`

-find-viewsclj

(-find-views _ opts)

Returns a collection of :kasandra.schema/materialized-view

Returns a collection of `:kasandra.schema/materialized-view`
raw docstring

lookup-by-nameclj

(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.
raw docstring

make-primary-keyclj

(make-primary-key partition-key clustering-key)

match-column-definitionclj

(match-column-definition form)

returns a tuple of [(:column | :pk | :pk-column) payload]

returns  a tuple of [(:column | :pk | :pk-column) payload]
raw docstring

match-create-tableclj

(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`
raw docstring

match-create-table-clustering-keyclj

(match-create-table-clustering-key form)

Returns a vector of tuples like ["col-name" :asc]

Returns a vector of tuples like ["col-name" :asc]
raw docstring

match-create-table-clustering-key-columnclj

(match-create-table-clustering-key-column form)

match-create-table-option-itemclj

(match-create-table-option-item form)

match-create-table-optionsclj

(match-create-table-options form)

match-create-table-withclj

(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]*]}
raw docstring

match-create-viewclj

(match-create-view form)

match-option-hash-itemclj

(match-option-hash-item form)

match-primary-keyclj

(match-primary-key form)

match-view-clustering-orderclj

(match-view-clustering-order form)

MatchBasedSchemaInfoProviderclj


materialized-viewsclj

(materialized-views provider parsed)

Returns a collection of materialized view defintions.

Returns a collection of materialized view defintions.
raw docstring

primary-key-column-namesclj

(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.
raw docstring

schema-indexclj

(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
raw docstring

schema-infoclj

(schema-info provider cql)
(schema-info provider cql 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.
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.
raw docstring

SchemaParsercljprotocol

Parses DB schema and outputs something TableInfoProvider and ViewInfoProvider can use.

Parses DB schema and outputs something `TableInfoProvider` and
`ViewInfoProvider` can use.

-parseclj

(-parse self input)
raw docstring

search-schema-infoclj

(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.
raw docstring

syntax-comma?clj

(syntax-comma? form)

TableInfoProvidercljprotocol

Extracts table definition from parser output.

Extracts table definition from parser output.

-tablesclj

(-tables this parsed)

Returns a collection of table definitions.

Returns a collection of table definitions.
raw docstring

tablesclj

(tables provider parsed)

Returns a collection of table definitions.

Returns a collection of table definitions.
raw docstring

ViewInfoProvidercljprotocol

Extracts materialized view definitions from parser output

Extracts materialized view definitions from parser output

-viewsclj

(-views this parsed)

Returns a collection of view definitions

Returns a collection of view definitions
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close