type: table
type: number
type: number
type: number
type: number
type: number
type: number
type: number
type: number
type: number
type: number
type: number
type: number
type: number
type: number
type: number
type: number
type: number
type: number
type: number
type: number
type: number
type: number
type: number
type: number
type: number
type: number
type: number
type: number
type: function
(all conn query & params)
Return all results from a query.
Like exec, with the addition that returned rows are decoded by matching the returned oid
by to the corresponding decoder function in the table *decoders*.
type: cfunction
type: function
(col conn query & params)
Run a query that returns a single column with many rows and return an array with all
columns unpacked
type: function
(commit conn &opt v)
type: cfunction
type: cfunction
type: cfunction
type: cfunction
type: function
(exec conn query & params)
Execute a query against conn.
If the result is an error, it is thrown, use error? to check if a thrown error is a pq
error, which can be inspected with the result-* functions.
Params can be nil|boolean|string|buffer|number|u64|s64|array|tuple.
If a param is an array or tuple, this must be a triple of [oid:number is-binary:boolean
encoded:string|buffer].
Otherwise params can have the method :pq/encode returning an encoded triple as described.
type: function
(in-transaction? conn)
type: function
(json v)
type: function
(jsonb v)
type: cfunction
type: cfunction
type: cfunction
type: cfunction
type: cfunction
type: cfunction
type: cfunction
type: cfunction
type: cfunction
type: cfunction
type: cfunction
type: function
(rollback conn &opt v)
type: function
(row conn query & params)
Run a query like exec, returning the first result
type: cfunction
type: cfunction
type: function
(txn conn options & body)
Run body in an sql transaction with options.
Valid option table entries are:
:retry (default false)
:mode (default "") Query fragment used to begin the transaction.
The transaction is rolled back when:
- An error is raised.
- If pq/rollback is called.
The transaction is retried if
- The an error is raised and the error is a serializability error (\"40001\").
Returns the last form or the value of any inner calls to rollback.
Examples:
(pq/txn conn {:mode "ISOLATION LEVEL SERIALIZABLE" :retry true} ...)
(pq/txn conn (pq/rollback :foo))
type: function
(txn* conn options ftx)
function form of txn
type: function
(val conn query & params)
Run a query returning a single value and return that value or nil.
Docs generated by: https://github.com/andrewchambers/janet-md-doc