Liking cljdoc? Tell your friends :D

lighthouse.core


coerce-booleanclj

(coerce-boolean schema val)

Coerce sqlite booleans: 1 or 0 to clojure booleans

Coerce sqlite booleans: 1 or 0 to clojure booleans
raw docstring

coerce-instclj

(coerce-inst val)

Coerce json iso8601 to clojure #inst

Coerce json iso8601 to clojure #inst
raw docstring

coerce-timestamp-instclj

(coerce-timestamp-inst val)

Coerce timestamps to clojure #inst

Coerce timestamps to clojure #inst
raw docstring

colsclj

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

connectclj

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

createclj

(create s)

Creates a new database

Creates a new database
raw docstring

defqcljmacro

(defq conn filename)
(defq conn n 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 a 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 a fn some-sql in the current namespace

(some-sql {:name "test todo #1"})
raw docstring

deleteclj

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

disconnectclj

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

driver-class-nameclj

(driver-class-name s)

dropclj

(drop s)

Drops an existing database

Drops an existing database
raw docstring

insertclj

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

migrateclj

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

optsclj


parse-jsonclj

(parse-json schema val)

Parses json from pull queries

Parses json from pull queries
raw docstring

poolclj

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

pullclj

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

qclj

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

qualify-colclj

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

rollbackclj

(rollback c)
(rollback c m)

Rolls back a migration vector

Rolls back a migration vector
raw docstring

schemaclj

(schema c)

Shows the current lighthouse schema

Shows the current lighthouse schema
raw docstring

transactclj

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

updateclj

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

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

× close