Schema and catalog introspection over JDBC DatabaseMetaData, returning
normalized Clojure data. Each function takes a db spec or datasource (anything
next.jdbc/get-connection accepts) and, optionally, a table name.
Table and schema names are accepted as strings or keywords. Results use keyword names so they compose with the rest of psql-clj.
Schema and catalog introspection over JDBC `DatabaseMetaData`, returning normalized Clojure data. Each function takes a db spec or datasource (anything `next.jdbc/get-connection` accepts) and, optionally, a table name. Table and schema names are accepted as strings or keywords. Results use keyword names so they compose with the rest of psql-clj.
(columns db table)Return the columns of TABLE as a vector of maps ordered by position:
:name, :type (database type name), :sql-type (JDBC int), :size,
:nullable?, :default, :position.
Return the columns of TABLE as a vector of maps ordered by position: `:name`, `:type` (database type name), `:sql-type` (JDBC int), `:size`, `:nullable?`, `:default`, `:position`.
(foreign-keys db table)Return the foreign keys declared on TABLE as a vector of maps:
:name (constraint name), :column, and :references {:table … :column …}.
Return the foreign keys declared on TABLE as a vector of maps:
`:name` (constraint name), `:column`, and `:references` `{:table … :column …}`.(indexes db table)Return the indexes on TABLE as a vector of maps, one per index:
:name, :unique?, and :columns (a vector of column-name keywords in
index order). The implicit table-statistics row is skipped.
Return the indexes on TABLE as a vector of maps, one per index: `:name`, `:unique?`, and `:columns` (a vector of column-name keywords in index order). The implicit table-statistics row is skipped.
(primary-keys db table)Return the primary-key column names of TABLE (as keywords) in key order.
Return the primary-key column names of TABLE (as keywords) in key order.
(schemas db)Return the set of schema names (as keywords) in the database.
Return the set of schema names (as keywords) in the database.
(views db)Return the set of view names (as keywords) visible in the database.
Return the set of view names (as keywords) visible in the database.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |