SqliteDriverAdapter class
Adapter that executes QueryPlan objects against SQLite databases.
- Implemented types
Constructors
-
SqliteDriverAdapter.custom({required DatabaseConfig config, ConnectionFactory? connections, List<
DriverExtension> extensions = const [], SqliteWebTransport? transport}) -
Creates an adapter for the provided
configandconnections. -
SqliteDriverAdapter.file(String path, {List<
DriverExtension> extensions = const [], Map<String, Object?> options = const {}, SqliteWebTransport? transport}) -
Opens a database stored at
path. -
SqliteDriverAdapter.inMemory({List<
DriverExtension> extensions = const [], Map<String, Object?> options = const {}, SqliteWebTransport? transport}) - Opens an in-memory database connection using the shared connector.
Properties
- changeBus → QueryChangeBus
-
Change feed shared by this adapter and reactive Ormed queries.
no setterinherited
- codecs → ValueCodecRegistry
-
Registry of codecs used when marshalling values.
no setterinherited
- driverExtensions → DriverExtensionRegistry
-
no setterinherited
- driverName → String
-
Name of the current driver instance.
no setterinherited
- grammar → QueryGrammar
-
Query grammar used to compile ORM plans.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- metadata → DriverMetadata
-
Advertises the capabilities supported by this adapter.
no setterinherited
-
options
→ Map<
String, Object?> -
Driver options used to configure the adapter backend.
no setterinherited
- planCompiler → PlanCompiler
-
Compiler used by this adapter to translate ORM plans.
no setterinherited
- profile → SqlRemoteAdapterProfile
-
SQL profile used by this adapter.
no setterinherited
- recordsRawChanges → bool
-
Whether
executeRawshould publish the SQL write it executes.no setterinherited - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- schemaCompiler → SchemaPlanCompiler
-
Schema compiler used by the adapter.
no setterinherited
Methods
-
applySchemaPlan(
SchemaPlan plan) → Future< void> -
Executes the given
plan, typically inside a transaction when supported.inherited -
beginExternalChangeScope(
) → void -
Starts tracking changes for an adapter-level transaction or savepoint.
inherited
-
beginTransaction(
) → Future< void> - Begins a new database transaction.
-
close(
) → Future< void> -
Closes the underlying connections/resources.
inherited
-
closeBackend(
) → Future< void> - Closes backend-specific resources.
-
commitExternalChangeScope(
) → void -
Publishes the current adapter-level change scope after commit.
inherited
-
commitTransaction(
) → Future< void> - Commits the active database transaction.
-
createDatabase(
String name, {Map< String, Object?> ? options}) → Future<bool> - Creates a new database with the given name.
-
createSchema(
String name) → Future< bool> - Creates a new schema/namespace within the current database.
-
createSchemaState(
{required OrmConnection connection, required String ledgerTable}) → SchemaState? -
Returns a
SchemaStatecapable of dumping/loading the schema for the providedledgerTable, ornullif the driver cannot produce dumps. -
describeMutation(
MutationPlan plan) → StatementPreview -
Provides a statement preview for a mutation
planwithout executing it.inherited -
describeQuery(
QueryPlan plan) → StatementPreview -
Provides a statement preview for a read
planwithout executing it.inherited -
describeSchemaPlan(
SchemaPlan plan) → SchemaPreview -
Returns a preview of the SQL statements that would run for
plan.inherited -
disableForeignKeyConstraints(
) → Future< bool> -
Disables foreign key constraint checking.
Returns true if successful.
inherited
-
dropAllTables(
{String? schema}) → Future< void> -
Drops all tables from the database.
Automatically handles foreign key constraints.
inherited
-
dropDatabase(
String name) → Future< bool> - Drops a database with the given name. Throws if database doesn't exist.
-
dropDatabaseIfExists(
String name) → Future< bool> - Drops a database if it exists. Returns true if dropped, false if didn't exist.
-
dropSchemaIfExists(
String name) → Future< bool> - Drops a schema/namespace if it exists.
-
enableForeignKeyConstraints(
) → Future< bool> -
Enables foreign key constraint checking.
Returns true if successful.
inherited
-
execute(
QueryPlan plan) → Future< List< Map< >String, Object?> > -
Resolves
planinto raw rows where each map represents one record.inherited -
executeRaw(
String sql, [List< Object?> parameters = const []]) → Future<void> -
Executes an arbitrary SQL statement that does not return rows.
inherited
-
executeStatement(
String sql, List< Object?> parameters) → Future<int> - Executes a non-query SQL statement.
-
getCurrentSchema(
) → Future< String> - Gets the current schema/namespace being used.
-
hasColumn(
String table, String column, {String? schema}) → Future< bool> -
Determines if the given table has a specific column.
inherited
-
hasColumns(
String table, List< String> columns, {String? schema}) → Future<bool> -
Determines if the given table has all of the specified columns.
inherited
-
hasIndex(
String table, String index, {String? schema, String? type}) → Future< bool> -
Determines if the given table has a specific index.
Optionally check by index type ('primary', 'unique', or specific driver type).
inherited
-
hasTable(
String table, {String? schema}) → Future< bool> -
Determines if the given table exists.
inherited
-
hasView(
String view, {String? schema}) → Future< bool> -
Determines if the given view exists.
inherited
-
listColumns(
String table, {String? schema}) → Future< List< SchemaColumn> > -
Lists columns for
tablewithin an optionalschema.inherited -
listDatabases(
) → Future< List< String> > - Lists all databases/catalogs accessible to the current connection.
-
listForeignKeys(
String table, {String? schema}) → Future< List< SchemaForeignKey> > -
Lists foreign keys for
tablewithin an optionalschema.inherited -
listIndexes(
String table, {String? schema}) → Future< List< SchemaIndex> > -
Lists indexes for
tablewithin an optionalschema.inherited -
listSchemas(
) → Future< List< SchemaNamespace> > -
Lists the schemas/namespaces available in the connection.
inherited
-
listTables(
{String? schema}) → Future< List< SchemaTable> > -
Lists all user tables on the connection, optionally filtered by
schema.inherited -
listViews(
{String? schema}) → Future< List< SchemaView> > -
Lists all views on the connection, optionally filtered by
schema.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
queryRaw(
String sql, [List< Object?> parameters = const []]) → Future<List< Map< >String, Object?> > -
Executes a raw SQL query and returns the resulting rows.
inherited
-
queryStatement(
String sql, List< Object?> parameters) → Future<List< Map< >String, Object?> > - Executes a query SQL statement and returns raw rows.
-
recordExternalAllTablesChanged(
) → void -
Records an opaque change for a write performed by an adapter integration.
inherited
-
recordExternalSqlChange(
String sql) → void -
Records a SQLite-like SQL statement against the reactive change feed.
inherited
-
recordExternalTablesChanged(
Iterable< String> tables) → void -
Records a table change for a write performed by an adapter integration.
inherited
-
registerExtensions(
Iterable< DriverExtension> extensions) → void -
inherited
-
rollbackExternalChangeScope(
) → void -
Discards the current adapter-level change scope after rollback.
inherited
-
rollbackTransaction(
) → Future< void> - Rolls back the active database transaction.
-
runMutation(
MutationPlan plan) → Future< MutationResult> -
Executes a structured mutation plan (insert/update/delete).
inherited
-
setCurrentSchema(
String name) → Future< void> - Sets the current schema/namespace for operations.
-
stream(
QueryPlan plan) → Stream< Map< String, Object?> > -
Streams rows for
plan. Drivers may override to avoid buffering.inherited -
threadCount(
) → Future< int?> - Returns the number of open connections reported by the backend, when supported.
-
toString(
) → String -
A string representation of this object.
inherited
-
transaction<
R> (Future< R> action()) → Future<R> - Starts a new transaction boundary.
-
truncateTable(
String tableName) → Future< void> - Truncates a table, removing all rows and resetting auto-increment counters.
-
withoutForeignKeyConstraints<
T> (Future< T> callback()) → Future<R> -
Executes a callback with foreign key constraints disabled.
Automatically re-enables constraints after callback completes.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
registerCodecs(
) → void - Registers SQLite-specific codecs and type mapper with the global registries. Call this once during application initialization before using SQLite.