The clj.intracel.sql-store.interface namespace defines a polylith interface for the SQL-Store.
Generally, this is te namespace users of the SQL-Store will put in their [[require]] statement
to use the component.
The `clj.intracel.sql-store.interface` namespace defines a polylith interface for the SQL-Store. Generally, this is te namespace users of the SQL-Store will put in their [[require]] statement to use the component.
(bulk-load db table-name rows)Bulk loads rows into the SQL-Store. The sql-db object should be a record implementing clj.intracel.api.interface.protocols/SQLStoreApi and containing a field called
sql-ctx containing a reference to a [[clj.intracel.api.interface.protocols/SQLStoreContext]].
Call the create-sql-db to create this reference before calling this function.
Depends on: [[sql-db]]
| Parameter | Description |
| -------------|-------------|
| sql-db | A reference to the clj.intracel.api.interface.protocols/SQLStoreApi created record. |
| table-name | The name of the table to bulk load. |
| rows | A vector of vectors containing values for the columns to insert into the table. These must be in the same order of the columns as defined in the table's schema definition.||
Returns:
A map containing the key loaded? set to true or false. If false, use the msg key to check the error message.
Bulk loads rows into the SQL-Store. The sql-db object should be a record implementing [[clj.intracel.api.interface.protocols/SQLStoreApi]] and containing a field called
`sql-ctx` containing a reference to a [[clj.intracel.api.interface.protocols/SQLStoreContext]].
Call the `create-sql-db` to create this reference before calling this function.
Depends on: [[sql-db]]
| Parameter | Description |
| -------------|-------------|
| `sql-db` | A reference to the `clj.intracel.api.interface.protocols/SQLStoreApi` created record. |
| `table-name` | The name of the table to bulk load. |
| `rows` | A vector of vectors containing values for the columns to insert into the table. These must be in the same order of the columns as defined in the table's schema definition.||
Returns:
A map containing the key `loaded?` set to true or false. If false, use the `msg` key to check the error message.(create-sql-store-context ctx-opts)Starts up the SQL-Store context which helps to bootstrap the embedded database.
| Parameter | Description |
| ------------|-------------|
| ctx-opts | Map containing options to adjust the behavior of the database at start-up.|
| | | :Key: | :Description: |
| | | -------------------------------------------------| --------------|
| | | :intracel.sql-store/type | Used to determine which type of data store to create. Currently only option is :duckdb.|
| | | :intracel.sql-store.duckdb/storage-path | Local filesystem path where the data will be persisted to disk.||
Returns: A [[clj.intracel.api.interface.protocols/SQLtoreContext]] with the :ctx field set to a map containing a connection pool and native DuckDB connection.
Starts up the SQL-Store context which helps to bootstrap the embedded database. | Parameter | Description | | ------------|-------------| | `ctx-opts` | Map containing options to adjust the behavior of the database at start-up.| | | | :Key: | :Description: | | | | -------------------------------------------------| --------------| | | | `:intracel.sql-store/type` | Used to determine which type of data store to create. Currently only option is `:duckdb`.| | | | `:intracel.sql-store.duckdb/storage-path` | Local filesystem path where the data will be persisted to disk.|| Returns: A [[clj.intracel.api.interface.protocols/SQLtoreContext]] with the :ctx field set to a map containing a connection pool and native DuckDB connection.
(db sql-db-ctx)Constructor function for an embedded SQL-Store. See clj.intracel.api.interface.protocols/SQLStoreApi
Depends on: [[cl.intracel.api.interface.protocols/SQLStoreDbContextApi]].
| Parameter | Description |
| -------------|-------------|
| sql-db-ctx | A reference to the clj.intracel.api.interface.protocols/SQLStoreDbContextApi.||
Returns:
A record that implements the clj.intracel.api.interface.protocols/SQLStoreApi with a field called sql-ctx that references the [[clj.intracel.api.interface.protocols/SQLStoreContext]] provided in the sql-db-ctx parameter.
Constructor function for an embedded SQL-Store. See [[clj.intracel.api.interface.protocols/SQLStoreApi]] Depends on: [[cl.intracel.api.interface.protocols/SQLStoreDbContextApi]]. | Parameter | Description | | -------------|-------------| | `sql-db-ctx` | A reference to the [[clj.intracel.api.interface.protocols/SQLStoreDbContextApi]].|| Returns: A record that implements the [[clj.intracel.api.interface.protocols/SQLStoreApi]] with a field called `sql-ctx` that references the [[clj.intracel.api.interface.protocols/SQLStoreContext]] provided in the `sql-db-ctx` parameter.
Polymorphic constructor for producing a specific implementation that will be assigned ot the :ctx field in the [[clj.api.interface.protocols/SQLStoreContext]].
This function requires the ctx-opts map to contain the :intracel.sql-store/type field and will determine the correct implementation to generate based on the value provided.
| Parameter | Description |
| ------------|-------------|
| ctx-opts | Map containing options to adjust the behavior of the database at start-up.|
| | | :Key: | :Description: |
| | | -------------------------------------------------| --------------|
| | | :intracel.sql-store/type | Used to determine which type of data store to create. Currently only option is :lmdb.|
| | | :intracel.sql-store.duckdb/storage-path | Local filesystem path where the data will be persisted to disk.||
Returns:
A data structure to be assigned to the :ctx field in the [[clj.intracel.api.interface.protocols/KVStoreContext]]
Polymorphic constructor for producing a specific implementation that will be assigned ot the `:ctx` field in the [[clj.api.interface.protocols/SQLStoreContext]]. This function requires the ctx-opts map to contain the `:intracel.sql-store/type` field and will determine the correct implementation to generate based on the value provided. | Parameter | Description | | ------------|-------------| | `ctx-opts` | Map containing options to adjust the behavior of the database at start-up.| | | | :Key: | :Description: | | | | -------------------------------------------------| --------------| | | | `:intracel.sql-store/type` | Used to determine which type of data store to create. Currently only option is `:lmdb`.| | | | `:intracel.sql-store.duckdb/storage-path` | Local filesystem path where the data will be persisted to disk.|| Returns: A data structure to be assigned to the `:ctx` field in the [[clj.intracel.api.interface.protocols/KVStoreContext]]
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 |