Liking cljdoc? Tell your friends :D

datahike.pg.sql

SQL → Datahike Datalog translator.

Parses SQL strings using JSqlParser and translates the AST into Datahike Datalog queries that can be executed by datahike.api/q.

The core mapping: attribute namespace prefixes become virtual table names. :person/name → table 'person', column 'name' :person/age → table 'person', column 'age'

Main entry points: (parse-sql sql schema) → {:type :select :query {...} :args [...]} | {:type :insert :tx-data [...]} | {:type :system :result QueryResult} | {:type :error :message str}

SQL → Datahike Datalog translator.

Parses SQL strings using JSqlParser and translates the AST into Datahike
Datalog queries that can be executed by `datahike.api/q`.

The core mapping: attribute namespace prefixes become virtual table names.
  :person/name  → table 'person', column 'name'
  :person/age   → table 'person', column 'age'

Main entry points:
  (parse-sql sql schema)  → {:type :select :query {...} :args [...]}
                           | {:type :insert :tx-data [...]}
                           | {:type :system :result QueryResult}
                           | {:type :error :message str}
raw docstring

*catalog-cache*clj

Tests can rebind this to an isolated java.util.Map to keep their data from polluting the global cache (or vice versa). Nil disables caching entirely. Defaults to the server-wide cache.

Tests can rebind this to an isolated `java.util.Map` to keep their
data from polluting the global cache (or vice versa). Nil disables
caching entirely. Defaults to the server-wide cache.
raw docstring

->ParamRefclj


add-clause!clj


coerce-insert-valueclj


col-var!clj


collect-varsclj


entity-var!clj


eval-check-predicateclj


eval-update-exprclj


extract-empty-catalog-shapeclj


filter-avgclj


filter-corrclj


filter-countclj


filter-count-distinctclj


filter-maxclj


filter-minclj


filter-stddev-sampclj


filter-sumclj


filter-variance-sampclj


fresh-var!clj


make-columns-optional!clj


make-ctxclj


materialize-arg!clj


null-guard-clausesclj


null-safeclj


param-ref?clj


ParamRefclj


parse-sqlclj

(parse-sql sql schema)
(parse-sql sql schema db)

Parse a SQL statement and return a translation result.

Returns one of: {:type :select :query <datalog-map> :find-aliases [...] ...} {:type :insert :tx-data [...] :count N} {:type :update :table str :ns str :assignments [...] :where-expr expr} {:type :delete :table str :ns str :where-expr expr} {:type :ddl-create :tx-data [...]} {:type :system :system-type keyword} {:type :error :message str}

Optional db parameter enables subquery execution during translation.

Parse a SQL statement and return a translation result.

Returns one of:
  {:type :select :query <datalog-map> :find-aliases [...] ...}
  {:type :insert :tx-data [...] :count N}
  {:type :update :table str :ns str :assignments [...] :where-expr expr}
  {:type :delete :table str :ns str :where-expr expr}
  {:type :ddl-create :tx-data [...]}
  {:type :system :system-type keyword}
  {:type :error :message str}

Optional db parameter enables subquery execution during translation.
raw docstring

register-catalog-table!clj


resolve-columnclj


resolve-inherited-attrclj


sql-*clj


sql-+clj


sql--clj


sql-divclj


sql-modclj


substitute-paramsclj


system-query?clj


translate-predicateclj


unregister-catalog-table!clj

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close