A storage implementation over in-memory indexing. Includes full query engine.
A storage implementation over in-memory indexing. Includes full query engine.
(as-connection graph)
(as-connection graph uri)
(as-connection G__20296)
(as-connection G__20300 G__20301)
Inputs: ([graph :- Graphable] [graph :- Graphable uri :- s/Str]) Returns: ConnectionType
Creates a Database/Connection around an existing Graph. graph: The graph or graph wrapper to build a database around. uri: The uri of the database.
Inputs: ([graph :- Graphable] [graph :- Graphable uri :- s/Str]) Returns: ConnectionType Creates a Database/Connection around an existing Graph. graph: The graph or graph wrapper to build a database around. uri: The uri of the database.
(check-attachment connection)
Checks if a connection is attached to the connections map. If not, then reconnect if still open. Returns the connection if previously connected, false if it needed to be reconnected. Throws an exception if the graph is closed.
Checks if a connection is attached to the connections map. If not, then reconnect if still open. Returns the connection if previously connected, false if it needed to be reconnected. Throws an exception if the graph is closed.
(connect uri)
Inputs: [uri :- s/Str] Returns: ConnectionType
Connects to the specified database, returning a Connection. In-memory databases get created if they do not exist already. Memory graphs: asami:mem://dbname A standard graph asami:multi://dbname A multigraph
Inputs: [uri :- s/Str] Returns: ConnectionType Connects to the specified database, returning a Connection. In-memory databases get created if they do not exist already. Memory graphs: asami:mem://dbname A standard graph asami:multi://dbname A multigraph
(create-database uri)
Inputs: [uri :- s/Str] Returns: s/Bool
Creates database specified by uri. Returns true if the database was created, false if it already exists.
Inputs: [uri :- s/Str] Returns: s/Bool Creates database specified by uri. Returns true if the database was created, false if it already exists.
(delete-database uri)
Inputs: [uri :- s/Str] Returns: s/Bool
Deletes the database specified by the URI. Returns true if the delete occurred.
Inputs: [uri :- s/Str] Returns: s/Bool Deletes the database specified by the URI. Returns true if the delete occurred.
(entity d id)
(entity d id nested?)
Wrapper around the storage/entity function so that connections can be asked for entities. d: a connection or database id: an identifier for an entity
Wrapper around the storage/entity function so that connections can be asked for entities. d: a connection or database id: an identifier for an entity
(export-data database)
Returns a simplified data structures of all statements in a database
Returns a simplified data structures of all statements in a database
(export-str database)
A wrapper on export-data to serialize to a string
A wrapper on export-data to serialize to a string
(get-database-names)
Inputs: []
Returns a seq of database names that this instance is aware of.
Inputs: [] Returns a seq of database names that this instance is aware of.
(get-timeout)
Retrieves the timeout value to use in ms
Retrieves the timeout value to use in ms
(import-data connection data)
(import-data connection opts data)
Loads raw statements into a connection. This does no checking of existing contents of storage. Accepts either a seq of tuples, or an EDN string which contains a seq of tuples. Optionally accepts options for reading a string (will be ignored if the data is not a string). These options are the same as for clojure.edn/read and cljs.reader/read.
Loads raw statements into a connection. This does no checking of existing contents of storage. Accepts either a seq of tuples, or an EDN string which contains a seq of tuples. Optionally accepts options for reading a string (will be ignored if the data is not a string). These options are the same as for clojure.edn/read and cljs.reader/read.
(q query & inputs)
Execute a query against the provided inputs.
The query can be a map, a seq, or a string.
See the documentation at https://github.com/quoll/asami/wiki/6.-Querying
for a full description of queries.
The end of the parameters may include a series of key/value pairs for query options.
The only recognized option for now is:
:planner :user
This ensures that a query is executed in user-specified order, and not the order calculated by the optimizing planner.
Execute a query against the provided inputs. The query can be a map, a seq, or a string. See the documentation at https://github.com/quoll/asami/wiki/6.-Querying for a full description of queries. The end of the parameters may include a series of key/value pairs for query options. The only recognized option for now is: `:planner :user` This ensures that a query is executed in user-specified order, and not the order calculated by the optimizing planner.
(release conn)
Inputs: [conn :- StringOrConnection]
Inputs: [conn :- StringOrConnection]
(show-plan query & inputs)
Return a query plan and do not execute the query.
All parameters are identical to the q
function.
Return a query plan and do not execute the query. All parameters are identical to the `q` function.
(shutdown)
Releases all connection resources for a clean shutdown. This should only be called during shutdown, and not if further database access is desired.
Releases all connection resources for a clean shutdown. This should only be called during shutdown, and not if further database access is desired.
(transact connection tx-info)
Inputs: [connection :- ConnectionType tx-info :- TransactData]
This returns a completed future with the data from a transaction. See the documentation for transact-async for full details on arguments. If the transaction times out, the call to transact will throw an ExceptionInfo exception. The default is 100 seconds
The result derefs to a map of:
:db-before database value before the transaction
:db-after database value after the transaction
:tx-data a sequence of the transacted datom operations
:tempids a map of temporary id values and the db identifiers that were allocated for them}
Inputs: [connection :- ConnectionType tx-info :- TransactData] This returns a completed future with the data from a transaction. See the documentation for transact-async for full details on arguments. If the transaction times out, the call to transact will throw an ExceptionInfo exception. The default is 100 seconds The result derefs to a map of: :db-before database value before the transaction :db-after database value after the transaction :tx-data a sequence of the transacted datom operations :tempids a map of temporary id values and the db identifiers that were allocated for them}
Inputs: [connection :- ConnectionType tx-info :- TransactData]
This is a thin wrapper around the transact-async function. TODO: convert this to a promise-based approach for the async implementation See the documentation for transact-async for full details on arguments. returns a deref'able object that derefs to a map of: :db-before database value before the transaction :db-after database value after the transaction :tx-data a sequence of the transacted datom operations :tempids a map of temporary id values and the db identifiers that were allocated for them}
Inputs: [connection :- ConnectionType tx-info :- TransactData] This is a thin wrapper around the transact-async function. TODO: convert this to a promise-based approach for the async implementation See the documentation for transact-async for full details on arguments. returns a deref'able object that derefs to a map of: :db-before database value before the transaction :db-after database value after the transaction :tx-data a sequence of the transacted datom operations :tempids a map of temporary id values and the db identifiers that were allocated for them}
(transact-async {:keys [name state] :as connection} tx-info)
Inputs: [{:keys [name state], :as connection} :- ConnectionType tx-info :- TransactData]
Updates a database. connection: The connection to the database to be updated. tx-info: This is either a seq of items to be transacted, or a map. If this is a map, then a :tx-data value will contain the same type of seq that tx-info may have. Each item to be transacted is one of: - vector of the form: [:db/add entity attribute value] - creates a datom - vector of the form: [:db/retract entity attribute value] - removes a datom - map: an entity to be inserted/updated. Alternatively, a map may have a :tx-triples key. If so, then this is a seq of 3 element vectors. Each vector in a :tx-triples seq will contain the raw values for [entity attribute value] :executor An optional value in the tx-info containing an executor to be used to run the CompletableFuture :input-limit contains an optional maximum number of statements to insert (approx) Entities and assertions may have attributes that are keywords with a trailing ' character. When these appear an existing attribute without that character will be replaced. This only occurs for the top level entity, and is not applied to attributes appearing in nested structures. Entities can be assigned a :db/id value. If this is a negative number, then it is considered a temporary value and will be mapped to a system-allocated ID. Other entities can reference such an entity using that ID. Entities can be provided a :db/ident value of any type. This will be considered unique, and can be used to identify entities for updates in subsequent transactions.
Returns a future/delay object that will hold a map containing the following: :db-before database value before the transaction :db-after database value after the transaction :tx-data sequence of datoms produced by the transaction :tempids mapping of the temporary IDs in entities to the allocated nodes
Inputs: [{:keys [name state], :as connection} :- ConnectionType tx-info :- TransactData] Updates a database. connection: The connection to the database to be updated. tx-info: This is either a seq of items to be transacted, or a map. If this is a map, then a :tx-data value will contain the same type of seq that tx-info may have. Each item to be transacted is one of: - vector of the form: [:db/add entity attribute value] - creates a datom - vector of the form: [:db/retract entity attribute value] - removes a datom - map: an entity to be inserted/updated. Alternatively, a map may have a :tx-triples key. If so, then this is a seq of 3 element vectors. Each vector in a :tx-triples seq will contain the raw values for [entity attribute value] :executor An optional value in the tx-info containing an executor to be used to run the CompletableFuture :input-limit contains an optional maximum number of statements to insert (approx) Entities and assertions may have attributes that are keywords with a trailing ' character. When these appear an existing attribute without that character will be replaced. This only occurs for the top level entity, and is not applied to attributes appearing in nested structures. Entities can be assigned a :db/id value. If this is a negative number, then it is considered a temporary value and will be mapped to a system-allocated ID. Other entities can reference such an entity using that ID. Entities can be provided a :db/ident value of any type. This will be considered unique, and can be used to identify entities for updates in subsequent transactions. Returns a future/delay object that will hold a map containing the following: :db-before database value before the transaction :db-after database value after the transaction :tx-data sequence of datoms produced by the transaction :tempids mapping of the temporary IDs in entities to the allocated nodes
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close