Liking cljdoc? Tell your friends :D

views.sql.core


hint-typeclj

source

query-infoclj

(query-info sql)
source

query-info-cacheclj

source

query-tablesclj

(query-tables sql)
source

vexec!clj

(vexec! view-system db sqlvec & options)
(vexec! view-system db sqlvec tables & options)

Used to run any SQL insert/update/delete query on the database while ensuring that view hints are sent to the view system to trigger any relevant view refreshes. Use this instead of calling clojure.java.jdbc/execute! or clojure.java.jdbc/insert!. If you need to perform an operation in a transaction use with-view-transaction.

Arguments are:

  • db: a clojure.java.jdbc database connection
  • sqlvec: a JDBC-style vector containing a SQL query string followed by any parameters for the query.

Options are:

  • namespace: a namespace that will be included in the hints sent out

NOTE: If the SQL being run cannot be parsed (e.g. due to use of database-specific extensions, or other limitations of JSqlParser), you will need to manually specify the list of table names (as keywords) that the SQL query will affect as the optional tables argument. In addition, if the SQL query includes a RETURNING clause, you should specify :returning true in the options given to vexec!, since automatic detection of this will not work if the SQL cannot be parsed.

Used to run any SQL insert/update/delete query on the database while ensuring
that view hints are sent to the view system to trigger any relevant view
refreshes. Use this instead of calling clojure.java.jdbc/execute! or
clojure.java.jdbc/insert!. If you need to perform an operation in a transaction
use with-view-transaction.

Arguments are:
- db: a clojure.java.jdbc database connection
- sqlvec: a JDBC-style vector containing a SQL query string followed by any
          parameters for the query.

Options are:
- namespace: a namespace that will be included in the hints sent out

NOTE:
If the SQL being run cannot be parsed (e.g. due to use of database-specific
extensions, or other limitations of JSqlParser), you will need to manually
specify the list of table names (as keywords) that the SQL query will affect
as the optional tables argument. In addition, if the SQL query includes a
RETURNING clause, you should specify :returning true in the options given
to vexec!, since automatic detection of this will not work if the SQL cannot
be parsed.
sourceraw docstring

with-view-transactioncljmacro

(with-view-transaction view-system binding & forms)

Works exactly like clojure.java.jdbc/with-db-transaction. Use this instead to wrap vexec! calls which need to be run in a transaction. Holds all view system hints generated by any vexec! calls within the transaction until the end, at which point they are all sent to the view system.

Works exactly like clojure.java.jdbc/with-db-transaction. Use this instead to wrap
vexec! calls which need to be run in a transaction. Holds all view system hints
generated by any vexec! calls within the transaction until the end, at which point
they are all sent to the view system.
sourceraw docstring

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

× close