routier-collection / core/src / IDbPlugin
Interface: IDbPlugin
Defined in: core/src/plugins/types.ts:9
Interface for a database plugin, which provides query, destroy, and bulk operations.
Methods
query()
query<
TRoot,TShape>(event,done):void
Defined in: core/src/plugins/types.ts:15
Executes a query operation on the database.
Type Parameters
TRoot
TRoot extends object
TShape
TShape extends unknown = TRoot
Parameters
event
DbPluginQueryEvent<TRoot, TShape>
The query event containing schema, parent, and query operation.
done
PluginEventCallbackResult<ITranslatedValue<TShape>>
Callback with the result or error. The result must be wrapped in an ITranslatedValue to allow the datastore to iterate over results (for grouped queries) and determine if change tracking should be enabled.
Returns
void
destroy()
destroy(
event,done):void
Defined in: core/src/plugins/types.ts:20
Destroys or cleans up the plugin, closing connections or freeing resources.
Parameters
event
done
PluginEventCallbackResult<never>
Callback with an optional error.
Returns
void
bulkPersist()
bulkPersist(
event,done):void
Defined in: core/src/plugins/types.ts:26
Executes bulk operations (add, update, remove) on the database.
Parameters
event
The bulk operations event containing schema, parent, and changes.
done
PluginEventCallbackPartialResult<BulkPersistResult>
Callback with the result or error.
Returns
void