SqliteProvider class
Retrieves from a Sqlite database
Constructors
- SqliteProvider(String dbName, {required DatabaseFactory databaseFactory, required SqliteModelDictionary modelDictionary})
Properties
- databaseFactory → DatabaseFactory
-
Access the SQLite,
instance agnostically across platforms.
final
- dbName → String
-
The file name for the database used.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- modelDictionary → SqliteModelDictionary
-
The glue between app models and generated adapters
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
delete<
TModel extends SqliteModel> (TModel instance, {Query? query, ModelRepository< SqliteModel> ? repository}) → Future<int> -
Remove record from SQLite.
query
is ignored. -
exists<
TModel extends SqliteModel> ({Query? query, ModelRepository< SqliteModel> ? repository}) → Future<bool> -
Returns
true
ifTModel
exists in SQLite. -
get<
TModel extends SqliteModel> ({Query? query, ModelRepository< SqliteModel> ? repository}) → Future<List< TModel> > -
Fetch one time from the SQLite database
Available query
providerArgs
: -
getDb(
) → Future< Database> - Access the latest instantiation of the database safely.
-
lastMigrationVersion(
) → Future< int> -
migrate(
List< Migration> migrations) → Future<void> -
Update database structure with latest migrations. Note that this will run
the
migrations
in the order provided. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
rawExecute(
String sql, [List? arguments]) → Future< void> - Execute a raw SQL statement. Advanced use only.
-
rawGet<
TModel extends SqliteModel> (String sql, List arguments, {ModelRepository< SqliteModel> ? repository}) → Future<List< TModel> > - Fetch results for model with a custom SQL statement. It is recommended to use get whenever possible. Advanced use only.
-
rawInsert(
String sql, [List? arguments]) → Future< int> - Insert with a raw SQL statement. Advanced use only.
-
rawQuery(
String sql, [List? arguments]) → Future< List< Map< >String, Object?> > - Query with a raw SQL statement. Advanced use only.
-
resetDb(
) → Future< void> - Reset the DB by deleting and recreating it.
-
toString(
) → String -
A string representation of this object.
inherited
-
transaction<
T> (Future< T> callback(Transaction transaction)) → Future<T> -
Perform actions within a database transaction.
DO NOT access
sqliteProvider
methods withincallback
. Instead, access DB methods and properties from transaction. Advanced use only. -
upsert<
TModel extends SqliteModel> (TModel instance, {Query? query, ModelRepository< SqliteModel> ? repository}) → Future<int?> - Insert record into SQLite. Returns the primary key of the record inserted
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited