SqliteProvider class
Retrieves from a Sqlite database
Constructors
- SqliteProvider.new(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<
_Model extends SqliteModel> (_Model instance, {Query? query, ModelRepository< SqliteModel> ? repository}) → Future<int> -
Remove record from SQLite.
query
is ignored. -
exists<
_Model extends SqliteModel> ({Query? query, ModelRepository< SqliteModel> ? repository}) → Future<bool> -
Returns
true
if_Model
exists in SQLite. -
get<
_Model extends SqliteModel> ({Query? query, ModelRepository< SqliteModel> ? repository}) → Future<List< _Model> > -
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<
_Model extends SqliteModel> (String sql, List arguments, {ModelRepository< SqliteModel> ? repository}) → Future<List< _Model> > - 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> > - 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
-
upsert<
_Model extends SqliteModel> (_Model 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