(coerce-boolean schema val)
Coerce sqlite booleans: 1 or 0 to clojure booleans
Coerce sqlite booleans: 1 or 0 to clojure booleans
(coerce-inst val)
Coerce json iso8601 to clojure #inst
Coerce json iso8601 to clojure #inst
(coerce-timestamp-inst val)
Coerce timestamps to clojure #inst
Coerce timestamps to clojure #inst
(cols c k)
Lists the columns in the db given the table name as keyword
Ex:
(cols :table-name) ; => corresponds to postgres table table_name
Lists the columns in the db given the table name as keyword Ex: (cols :table-name) ; => corresponds to postgres table table_name
(connect s)
(connect s m)
Takes a string returns a connection pool from a connection string
Takes a string returns a connection pool from a connection string
(defq conn filename)
Use regular .sql files and call them as functions
Ex:
test.sql: -- name: some-sql select * from todo where todo.name = :name
clojure: (defq "test.sql")
creates fn some-sql in the current namespace
(some-sql {:name "test todo #1"})
Use regular .sql files and call them as functions Ex: test.sql: -- name: some-sql select * from todo where todo.name = :name clojure: (defq "test.sql") creates fn some-sql in the current namespace (some-sql {:name "test todo #1"})
(delete conn val)
Deletes a map or a vector of maps by primary key only
Deletes a map or a vector of maps by primary key only
(disconnect m)
Takes a lighthouse {:datasource ^HikariDataSource} map and closes the connection to the database
Takes a lighthouse {:datasource ^HikariDataSource} map and closes the connection to the database
(driver-class-name s)
(insert conn val)
Inserts a map or a vector of maps into the db. All maps need to have the same keys.
Inserts a map or a vector of maps into the db. All maps need to have the same keys.
(migrate c migration)
(migrate c migration m)
Takes a jdbc connection or datasource and a migration vector
Takes a jdbc connection or datasource and a migration vector
(parse-json schema val)
Parses json from pull queries
Parses json from pull queries
(pool s m)
Shamelessly stolen from hikari-cp and makes a new hikaricp data source
Shamelessly stolen from hikari-cp and makes a new hikaricp data source
(pull conn v where-clause)
The main entry point for queries that return a nested result based on a lighthouse schema and a primary key
The main entry point for queries that return a nested result based on a lighthouse schema and a primary key
(q conn v)
(q conn v params)
The main entry point for queries
Ex: (q conn '[:select todo/*])
The main entry point for queries Ex: (q conn '[:select todo/*])
(qualify-col s)
This is a relatively complex function to replace col names with $ in them, pull comes at a cost
This is a relatively complex function to replace col names with $ in them, pull comes at a cost
(rollback c)
(rollback c m)
Rolls back a migration vector
Rolls back a migration vector
(schema c)
Shows the current lighthouse schema
Shows the current lighthouse schema
(transact conn query)
(transact conn query params)
Takes a jdbc connection, a query and an optional map of params
Ex: (transact conn '[:delete :from todo :where [todo/id 1]])
Takes a jdbc connection, a query and an optional map of params Ex: (transact conn '[:delete :from todo :where [todo/id 1]])
(update conn val)
Updates a map or a vector of maps in the db. All maps need to have one primary key and the same set of keys.
Updates a map or a vector of maps in the db. All maps need to have one primary key and the same set of keys.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close