(view id db-or-db-fn sql-fn & options)
(view id db-or-db-fn sql-fn tables & options)
Creates a SQL view that uses a JDBC database configuration.
Arguments are:
Options are:
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.
Creates a SQL view that uses a JDBC database configuration. Arguments are: - id: an id for this view that is unique within the view system - db-or-db-fn: either a database connection map, or a function that will get passed a namespace and should return a database connection map - sql-fn: a function that returns a JDBC-style vector containing a SELECT query followed by any parameters. this query will be run whenever this view needs to be refreshed. Options are: - row-fn: a function that if specified will be run against each row in the view's result set before returning it. - result-set-fn: a function that will be run against the entire view's result set before returning it. 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.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close