SnapshotSchemaDriver class

Lightweight driver backed entirely by a SchemaSnapshot.

Implemented types

Constructors

SnapshotSchemaDriver(SchemaSnapshot snapshot)

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
snapshot SchemaSnapshot
final

Methods

applySchemaPlan(SchemaPlan plan) Future<void>
Executes the given plan, typically inside a transaction when supported.
override
createDatabase(String name, {Map<String, Object?>? options}) Future<bool>
Creates a new database with the given name.
override
createSchema(String name) Future<bool>
Creates a new schema/namespace within the current database.
override
describeSchemaPlan(SchemaPlan plan) SchemaPreview
Returns a preview of the SQL statements that would run for plan.
override
disableForeignKeyConstraints() Future<bool>
Disables foreign key constraint checking. Returns true if successful.
override
dropAllTables({String? schema}) Future<void>
Drops all tables from the database. Automatically handles foreign key constraints.
override
dropDatabase(String name) Future<bool>
Drops a database with the given name. Throws if database doesn't exist.
override
dropDatabaseIfExists(String name) Future<bool>
Drops a database if it exists. Returns true if dropped, false if didn't exist.
override
dropSchemaIfExists(String name) Future<bool>
Drops a schema/namespace if it exists.
override
enableForeignKeyConstraints() Future<bool>
Enables foreign key constraint checking. Returns true if successful.
override
getCurrentSchema() Future<String>
Gets the current schema/namespace being used.
override
hasColumn(String table, String column, {String? schema}) Future<bool>
Determines if the given table has a specific column.
override
hasColumns(String table, List<String> columns, {String? schema}) Future<bool>
Determines if the given table has all of the specified columns.
override
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).
override
hasTable(String table, {String? schema}) Future<bool>
Determines if the given table exists.
override
hasView(String view, {String? schema}) Future<bool>
Determines if the given view exists.
override
listColumns(String table, {String? schema}) Future<List<SchemaColumn>>
Lists columns for table within an optional schema.
override
listDatabases() Future<List<String>>
Lists all databases/catalogs accessible to the current connection.
override
listForeignKeys(String table, {String? schema}) Future<List<SchemaForeignKey>>
Lists foreign keys for table within an optional schema.
override
listIndexes(String table, {String? schema}) Future<List<SchemaIndex>>
Lists indexes for table within an optional schema.
override
listSchemas() Future<List<SchemaNamespace>>
Lists the schemas/namespaces available in the connection.
override
listTables({String? schema}) Future<List<SchemaTable>>
Lists all user tables on the connection, optionally filtered by schema.
override
listViews({String? schema}) Future<List<SchemaView>>
Lists all views on the connection, optionally filtered by schema.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setCurrentSchema(String name) Future<void>
Sets the current schema/namespace for operations.
override
toString() String
A string representation of this object.
inherited
withoutForeignKeyConstraints<T>(Future<T> callback()) Future<T>
Executes a callback with foreign key constraints disabled. Automatically re-enables constraints after callback completes.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited