ReadonlynameThe name of the store (e.g. 'mongodb', 'redis', 'dynamodb')
ReadonlylibraryThe client library being used
Returns the underlying native Surreal client.
Create a record. thing may be a table name ('user', id auto-
generated) or a specific record id ('user:jane'). Passthrough to the
driver's Surreal.create().
Optionaldata: Record<string, unknown>Select a record or all records in a table. Passthrough to the driver's
Surreal.select().
Replace the content of a record (or every record in a table).
Passthrough to the driver's Surreal.update().
Optionaldata: Record<string, unknown>Merge the given data into a record (or every record in a table),
leaving unspecified fields intact. Passthrough to the driver's
Surreal.merge().
Optionaldata: Record<string, unknown>Delete a record (or every record in a table). Passthrough to the
driver's Surreal.delete().
Run a raw SurrealQL statement (or several ;-separated statements),
optionally binding vars as $name parameters. Returns the driver's
result array (one entry per statement). Passthrough to the driver's
Surreal.query().
Optionalvars: Record<string, unknown>ORM findAll. Compiles where/order/limit/offset to a bound
SurrealQL SELECT; on an un-pushable operator it selects the table and
filters/sorts/paginates client-side, so the result is always correct.
ORM findByPk: select a single table:id record, or null.
ORM count: number of records matching where.
Optionalwhere: WhereClauseORM update: merge values into every record matching where (or the
whole table when where is omitted). Returns the updated records.
Optionalwhere: WhereClauseORM destroy: delete every record matching where (or the whole table
when where is omitted). Returns the number of records deleted.
Optionalwhere: WhereClauseORM truncate: delete every record in a table.
Create a graph edge (association) between two records:
RELATE $from->edge->$to CONTENT $data. This is how many-to-many /
graph associations are expressed in SurrealDB, exposed through the ORM
API so callers never hand-write the RELATE themselves.
Optionaldata: Record<string, unknown>
SurrealStorewraps thesurrealdbdriver'sSurrealclient, exposing record CRUD (create/select/update/merge/delete) and raw SurrealQL (query) as a small promise-based API.