Skip to content

routier-collection


routier-collection / plugins/sqlite/src / SqliteDbPluginBase

Class: SqliteDbPluginBase ​

Defined in: plugins/sqlite/src/plugin.ts:47

The engine-independent half of the plugin.

Every statement it runs is built by utils.ts and @routier/sql-plugin-core, neither of which knows what a connection is. The concrete SqliteDbPlugin each environment exports differs only in which driver it defaults to.

Extended by ​

Implements ​

  • IDbPlugin

Constructors ​

Constructor ​

new SqliteDbPluginBase(databaseName, driver): SqliteDbPluginBase

Defined in: plugins/sqlite/src/plugin.ts:93

Parameters ​

databaseName ​

string

driver ​

SqliteDriver

Returns ​

SqliteDbPluginBase

Properties ​

databaseName ​

readonly databaseName: string

Defined in: plugins/sqlite/src/plugin.ts:55

See IDbPlugin.databaseName. This is the file path as the caller spelled it, which is as far as a plugin that also runs in the browser can go: resolving it needs a file system. Two spellings of one file — a relative and an absolute path — therefore read as two databases and will not share subscription channels. Pass a consistent path.

Implementation of ​

IDbPlugin.databaseName

Methods ​

query() ​

query<TRoot, TShape>(event, done): void

Defined in: plugins/sqlite/src/plugin.ts:177

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.

Returns ​

void

Implementation of ​

IDbPlugin.query


bulkPersist() ​

bulkPersist(event, done): void

Defined in: plugins/sqlite/src/plugin.ts:284

Executes bulk operations (add, update, remove) on the database.

Parameters ​

event ​

DbPluginBulkPersistEvent

The bulk operations event containing schema, parent, and changes.

done ​

PluginEventCallbackPartialResult<BulkPersistResult>

Callback with the result or error.

Returns ​

void

Implementation of ​

IDbPlugin.bulkPersist


destroy() ​

destroy(event, done): void

Defined in: plugins/sqlite/src/plugin.ts:387

Destroys or cleans up the plugin, closing connections or freeing resources.

Parameters ​

event ​

DbPluginEvent

done ​

PluginEventCallbackResult<never>

Callback with an optional error.

Returns ​

void

Implementation of ​

IDbPlugin.destroy

Released under the MIT License.