(create-table! conn dataset)
(create-table! conn dataset options)
Create a table. Exception upon failure to drop the table.
conn - java.sql.Connection dataset - dataset to use. The dataset-name will be used as the table-name and the column names and datatypes will be used for the sql names and datatypes. The dataset's dataset-name will be used for the table and if the dataset's metadata has a :primary-key member this will be interpreted as a sequence of column names to be used as the primary key.
options :table-name - set the name of the table to use. Overrides the dataset metadata. :primary-key - Array of column names to use as the primary key of this table. Overrides the dataset metadata.
Create a table. Exception upon failure to drop the table. conn - java.sql.Connection dataset - dataset to use. The dataset-name will be used as the table-name and the column names and datatypes will be used for the sql names and datatypes. The dataset's dataset-name will be used for the table and if the dataset's metadata has a :primary-key member this will be interpreted as a sequence of column names to be used as the primary key. options :table-name - set the name of the table to use. Overrides the dataset metadata. :primary-key - Array of column names to use as the primary key of this table. Overrides the dataset metadata.
(drop-table! conn dataset)
Drop a table. Exception upon failure to drop the table.
conn - java.sql.Connection dataset - string, keyword, symbol, or dataset.
Drop a table. Exception upon failure to drop the table. conn - java.sql.Connection dataset - string, keyword, symbol, or dataset.
(drop-table-when-exists! conn dataset)
Drop the table indicated by this dataset if it exists.
Drop the table indicated by this dataset if it exists.
(ensure-table! conn dataset)
(ensure-table! conn dataset options)
Create a table if it does not exist. See documentation for create-table!
Create a table if it does not exist. See documentation for create-table!
(insert-dataset! conn dataset)
(insert-dataset! conn dataset options)
Insert a dataset into a table indicated by the dataset name. options :postgres-upsert? - defaults to false. When true, generates postgres-specific sql that affects an upsert operation.
Insert a dataset into a table indicated by the dataset name. options :postgres-upsert? - defaults to false. When true, generates postgres-specific sql that affects an upsert operation.
(result-set->dataset results)
(result-set->dataset results {:keys [close?] :or {close? true} :as options})
Given a result set, return a dataset. options: :close? - if true, then .close is called on the resultset - always - including when there is an exception. Defaults to true.
Given a result set, return a dataset. options: :close? - if true, then .close is called on the resultset - always - including when there is an exception. Defaults to true.
(sanitize-dataset-names-for-sql ds)
Given a dataset, sanitize the dataset name and the names of all the columns such that they are safe for insert to SQL.
Given a dataset, sanitize the dataset name and the names of all the columns such that they are safe for insert to SQL.
(sql->dataset conn sql)
(sql->dataset conn sql options)
Given a connection and an sql statement, convert the results of executing the statement to a dataset. For options, see result-set->dataset
Given a connection and an sql statement, convert the results of executing the statement to a dataset. For options, see result-set->dataset
(table-exists? conn dataset)
Test if a table exists.
conn - java.sql.Connection dataset - string, keyword, symbol, or dataset.
Test if a table exists. conn - java.sql.Connection dataset - string, keyword, symbol, or dataset.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close