sqlite_plus_orm_io library

File databases use DbSet.openDbFile from sqlite_plus_orm.dart.

This library exports that API. The file implementation is selected when dart:io is available. On the Web DbSet.openDbFile throws UnsupportedError.

Classes

Bounds<T>
Bound comparisons for an rtree. The caller does not write the SQL.
BrowserDatabaseConnection
ORM connection over a browser or memory OpenedStorage.
ChangesOrmConnection
Optional transaction bridge shared with Changes/Sync. Query reads outside a scope also queue on Changes, so they cannot interleave a foreign writer.
Codecs
Built-in codecs for mapped Dart values, including one JSON object.
Column<T, V>
One mapped property: its SQL name, codec, and how to read or write it.
DbColumn
Overrides the SQL column derived from a field.
DbContext
One tracked unit of work with an exclusive connection and serialized SQL.
DbDocument
Stores one object as a JSON object in a TEXT column.
DbEntity
Selects a class for generation and optional virtual-table storage.
DbIgnore
Leaves a field out of the generated table.
DbJson
Marks one TEXT column for a generated JSON path helper.
DbKey
Marks a field as part of the primary key.
DbModel
The entities and foreign keys that form one schema.
DbModules
SQL module names the ORM knows how to create.
DbReference
Declares a foreign key from this field to target.
DbScalar
Marks an instance method or getter as a SQL scalar.
DbSet<T>
The tracked set of one entity type.
DbTokenizers
Built-in FTS tokenizer names.
DbVector
Marks one List<double> column of a DbModules.vec0 table.
DbVectorLimits
Limits shared by a mapped vector column and TypedQuery.nearest.
DbVectorMetrics
Distance names vec0 stores in distance_metric.
DbVersion
Marks the integer revision column incremented on update.
DocumentField<T, V>
A mapped object stored as one JSON text value.
EntityCollection<C, P>
A parent's children for one foreign key. The handle itself does no I/O.
EntityEntry<T>
One tracked entity and the snapshot taken when it was loaded or saved.
EntityKey
A copied primary-key value list.
EntityReference<C, P>
A child's link to one parent. The handle itself does no I/O.
EntityScalar<T>
A model method exposed as one SQL scalar.
EntityType<T>
Table mapping: columns, factory, and optional store-value writer.
ForeignKey<C, P>
A foreign key from child columns to a unique parent key.
JsonPathField<T>
A JSON path on a mapped column. Comparisons bind both the path and the value.
MappedField<T, V>
A mapped column used from a Dart closure. Equality is equalTo because Dart's == must return bool and cannot build a predicate. Parenthesize comparison operators before combining them with & or |.
MappedTable<T>
A mapped table whose search stays in Dart.
MigrationApproval
Approval cannot be reused for another plan, including a modified copy.
MigrationOperation
One immutable, reviewable action. Application-authored SQL always needs approval for the exact plan containing it.
MutableDatabaseConnection
ORM connection over a MutableSqliteDatabase.
OrmConnection
A SQLite connection the ORM can query, write, and close.
OrmImportIssue
OrmImportPlan<T>
Input preparation, not a promise about current DB inserted/updated counts. Plans capture encoded values; source data is resolved atomically at apply.
OrmIndex<T>
A secondary index declared on an EntityType.
OrmPreparedCommand
Adapter capability. Fallbacks preserve the adapter pipeline and explicitly report that they do not reuse engine syntax.
OrmQueryCommand
Reviewable generated SQL. Bound blobs are copied on every ownership boundary.
OrmWriteResult
SQL storage values after the operation (and its triggers), never tracked entities.
PageCursor
Portable, unsigned continuation token. Never use as authorization.
PageOrder
A column ordering, using its declared collation unless explicitly overridden.
PreparedOrmQuery<T>
PreparedOrmUpdate<T>
QueryParameter<V>
Binding identity, not a string substitution. Reuse the same object as a map key. Values are checked by this Dart type and each mapped column's codec.
ReactiveQuery<T>
A shared query stream. Cancelling the last listener drops the shared read.
ReactiveRowChange
One key's difference inside a ReactiveSnapshot.
ReactiveSnapshot<T>
The current rows and how they differ from the previous emission.
Rect
A rectangle in the same coordinate space as an rtree table.
RowReader
Decodes one stored row through column metadata.
SchemaMigrator
Schema changes through public SQL metadata and the public connection only.
SchemaPlan
A snapshot of the live schema, the desired model and the exact actions. A new plan is required whenever any schema object or the model changes.
SqlArgument<T>
One argument of a SqlCall, keeping the expression's own value type.
SqlCall<T, V>
A scalar call. Arguments are expressions or bound literals.
SqlExpression<T, V>
A SQL value built from mapped columns. Comparisons bind the right-hand side.
SqlOrdering<T>
One mapped ordering term. SQL's default NULL placement is preserved unless nullsFirst is supplied.
SqlPage<T>
Immutable list container. Entity/map/BLOB values follow their normal APIs.
SqlPredicate<T>
An immutable predicate built from mapped columns and bound values.
TypedQuery<T>
Immutable single-entity SQL query builder. Filters and ordering describe SQL clauses before pagination. Repeated skip/take operations compose a bounded interval; counts use the same interval.
ValueCodec<V>
Converts one Dart value to a SQLite storage value and back.

Enums

EntityState
Where an entity sits in the unit of work.
ForeignKeyAction
SQL action for a foreign-key delete or update.
MigrationKind
Kind of one step in a schema plan.
MigrationSafety
Whether an operation can run without a reviewed approval.
OrmImportDuplicates
OrmImportEmptyValues
ReactiveChangeKind
How one row moved between two snapshots.

Extensions

ColumnQueryExpressions on Column<T, V>
Bound comparisons and orderings on a Column.
DirectQueryWrites on TypedQuery<T>
DirectSetWrites on DbSet<T>
EntityRelationships on EntityEntry<T>
Explicit relationship access. Loading performs I/O; obtaining a handle or linking tracked entries does not.
NumericColumnWrites on Column<T, V>
OrmImports on DbSet<T>
ParameterColumnPredicates on Column<T, V>
PreparedTypedQueries on TypedQuery<T>
ReactiveDbContext on DbContext
RelationshipLoading on DbContext
Batch eager loading with bounded parameter lists. Results use the context's identity map and preserve local changes on already tracked entities.

Functions

copyOrmValue(Object? value) → Object?
ormValuesEqual(Object? left, Object? right) → bool
publishOrmScalar(Object? value) → Object?
Copy an encoded SQL value and reject unsupported or lossy values. Publishes a scalar-method result as a SQL value.
quoteIdentifier(String identifier) → String
Quotes identifier as a SQL delimited identifier.
registerOrmScalars(OrmConnection connection, Iterable<EntityType> entities) → void
Registers model scalars on the engine connection the ORM is using.

Typedefs

OrmOperationRunner = Future<R> Function<R>(Future<R> ())
A context supplies this function to serialize a complete query operation.

Exceptions / Errors

MigrationApprovalRequiredException
SchemaMigrator.apply was asked to run a plan that still needs approval.
MigrationRequiredException
The live schema does not match the model.
OptimisticConcurrencyException
A version column did not match the stored row.
OrmCodecException
A value could not be encoded or decoded for its column.
OrmException
Base failure for mapping, codec, state, and migration errors.
OrmMappingException
The model metadata cannot describe the requested schema or entity.
OrmStateException
The context or entity is in a state that rejects this call.
ReactiveLimitException
A watched query returned more rows than its budget.
SchemaChangedException
The database schema changed after the plan was created.