(ast-path->array-path path)Converts integers in path to strings so that the result is suitable for a text[].
Converts integers in path to strings so that the result is suitable for a text[].
(constraint-exists? table constraint)(constraint-exists? schema table constraint)Inputs: ([table :- s/Str constraint :- s/Str] [schema :- s/Str table :- s/Str constraint :- s/Str]) Returns: s/Bool
Inputs: ([table :- s/Str constraint :- s/Str] [schema :- s/Str table :- s/Str constraint :- s/Str]) Returns: s/Bool
(current-schema)Returns the current schema of the database connection on postgres.
Returns the current schema of the database connection on postgres.
(db-serialize value)Serialize value into a form appropriate for querying against a
serialized database column.
Serialize `value` into a form appropriate for querying against a serialized database column.
(fix-identity-sequence table column)Resets a sequence to the maximum value used in a column. Useful when a sequence gets out of sync due to a bug or after a transfer.
Resets a sequence to the maximum value used in a column. Useful when a sequence gets out of sync due to a bug or after a transfer.
(index-exists? index)(index-exists? index namespace)Inputs: ([index :- s/Str] [index :- s/Str namespace :- s/Str]) Returns: s/Bool
Returns true if the index exists. Only supported on PostgreSQL currently.
Inputs: ([index :- s/Str] [index :- s/Str namespace :- s/Str]) Returns: s/Bool Returns true if the index exists. Only supported on PostgreSQL currently.
(jsonb-null? column null?)A predicate determining whether the json types of a jsonb column are null.
A predicate determining whether the json types of a jsonb column are null.
(jsonb-path-binary-expression op column qmarks)Produce a predicate that compares against nested value with op and checks the existence of a (presumably) top-level value. The existence check is necessary because -> is not indexable (with GIN) but ? is. Assumes a GIN index on the column supplied.
Produce a predicate that compares against nested value with op and checks the existence of a (presumably) top-level value. The existence check is necessary because -> is not indexable (with GIN) but ? is. Assumes a GIN index on the column supplied.
(jsonb-scalar-regex column)Produce a predicate that matches a regex against a scalar jsonb value
Produce a predicate that matches a regex against a scalar jsonb value
(legacy-sql-regexp-match column)Returns the SQL for performing a regexp match.
Returns the SQL for performing a regexp match.
(munge-json-for-storage value)Prepare a clojure object for storage depending on db type.
Prepare a clojure object for storage depending on db type.
(munge-jsonb-for-storage value)Prepare a clojure object for storage. Rewrite all null (\u0000) characters to the replacement character (\ufffd) because Postgres cannot handle them in its JSON values.
Prepare a clojure object for storage. Rewrite all null (\u0000) characters to the replacement character (\ufffd) because Postgres cannot handle them in its JSON values.
(parse-db-json db-json)Inputs: [db-json :- (s/maybe (s/cond-pre s/Str PGobject))]
Produce a function for parsing an object stored as json.
Inputs: [db-json :- (s/maybe (s/cond-pre s/Str PGobject))] Produce a function for parsing an object stored as json.
(path-array-col-matches-any-ast-path column sig-col paths)Maps to the table definition in postgres, but only includes some of the columns:
Table pg_catalog.pg_extension Column | Type | Modifiers ----------------+---------+----------- extname | name | not null extrelocatable | boolean | not null extversion | text |
Maps to the table definition in postgres, but only includes some of the columns: Table pg_catalog.pg_extension Column | Type | Modifiers ----------------+---------+----------- extname | name | not null extrelocatable | boolean | not null extversion | text |
(pg-extension? extension)Inputs: [extension :- s/Str] Returns: s/Bool
Returns true if the named PostgreSQL extension is installed.
Inputs: [extension :- s/Str] Returns: s/Bool Returns true if the named PostgreSQL extension is installed.
(pg-installed-extensions)Inputs: [] Returns: #:s{Str pg-extension-map}
Obtain the extensions installed and metadata about each extension for the current database.
Inputs: []
Returns: #:s{Str pg-extension-map}
Obtain the extensions installed and metadata about each extension for
the current database.(sql-array-query-string column)Returns an SQL fragment representing a query for a single value being found in an array column in the database.
(str "SELECT ... WHERE " (sql-array-query-string "column_name"))
The returned SQL fragment will contain one parameter placeholder, which must be supplied as the value to be matched.
Returns an SQL fragment representing a query for a single value being found in an array column in the database. (str "SELECT ... WHERE " (sql-array-query-string "column_name")) The returned SQL fragment will contain *one* parameter placeholder, which must be supplied as the value to be matched.
(sql-array-type-string basetype)Returns the SQL to declare an array of the supplied base database type.
Returns the SQL to declare an array of the supplied base database type.
(sql-as-numeric column)Returns the SQL for converting the given column to a number, or to NULL if it is not numeric.
Returns the SQL for converting the given column to a number, or to NULL if it is not numeric.
(sql-current-connection-aggregate-names)Returns the names of all of the functions in the public schema of the current connection's database. This is most useful for debugging / testing purposes to allow introspection on the database. (Some of our unit tests rely on this.).
Returns the names of all of the functions in the public schema of the current connection's database. This is most useful for debugging / testing purposes to allow introspection on the database. (Some of our unit tests rely on this.).
(sql-current-connection-function-names)Returns the names of all of the functions in the public schema of the current connection's database. This is most useful for debugging / testing purposes to allow introspection on the database. (Some of our unit tests rely on this.).
Returns the names of all of the functions in the public schema of the current connection's database. This is most useful for debugging / testing purposes to allow introspection on the database. (Some of our unit tests rely on this.).
(sql-current-connection-sequence-names)Returns the names of all of the sequences in the public schema of the current connection's database. This is most useful for debugging / testing purposes to allow introspection on the database. (Some of our unit tests rely on this.).
Returns the names of all of the sequences in the public schema of the current connection's database. This is most useful for debugging / testing purposes to allow introspection on the database. (Some of our unit tests rely on this.).
(sql-current-connection-table-names)Returns the names of all of the tables in the public schema of the current connection's database. This is most useful for debugging / testing purposes to allow introspection on the database. (Some of our unit tests rely on this.).
Returns the names of all of the tables in the public schema of the current connection's database. This is most useful for debugging / testing purposes to allow introspection on the database. (Some of our unit tests rely on this.).
(sql-regexp-array-match-str column)Returns SQL for performing a regexp match against the contents of an array. If any of the array's items match the supplied regexp, then that satisfies the match.
Returns SQL for performing a regexp match against the contents of an array. If any of the array's items match the supplied regexp, then that satisfies the match.
(sql-regexp-array-match-v2 column)Returns SQL for performing a regexp match against the contents of an array. If any of the array's items match the supplied regexp, then that satisfies the match.
Returns SQL for performing a regexp match against the contents of an array. If any of the array's items match the supplied regexp, then that satisfies the match.
(sql-regexp-match column)Returns db code for performing a regexp match.
Returns db code for performing a regexp match.
(str->pgobject type value)Inputs: [type :- s/Str value] Returns: PGobject
Inputs: [type :- s/Str value] Returns: PGobject
(to-jdbc-varchar-array coll)Takes the supplied collection and transforms it into a JDBC-appropriate VARCHAR array.
Takes the supplied collection and transforms it into a JDBC-appropriate VARCHAR array.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |