sqlbrite library Null safety

sqlbrite

Author: Petrus Nguyễn Thái Học

Github: https://github.com/hoc081098

  • RxDart Reactive stream sqflite(sqlite) for Flutter
  • Sqlbrite for flutter
  • A lightweight wrapper around sqflite which introduces reactive stream semantics to SQL operations.

Classes

AbstractBriteDatabaseExecutor
Wrap sqlite_api.DatabaseExecutor to implement BriteDatabaseExecutor
Batch
A batch is used to perform multiple operation as a single atomic unit. A Batch object can be acquired by calling Database.batch. It provides methods for adding operation. None of the operation will be executed (or visible locally) until commit() is called. [...]
BriteDatabase
IBriteDatabase implementation. [...]
BriteDatabaseExecutor
Common API for BriteDatabase and BriteTransaction to execute SQL commands.
Database
Database to send sql commands, created during openDatabase
DatabaseExecutor
Common API for Database and Transaction to execute SQL commands
DatabaseFactory
Basic databases operations
IBriteBatch
A batch is used to perform multiple operation as a single atomic unit. A Batch object can be acquired by calling Database.batch. It provides methods for adding operation. None of the operation will be executed (or visible locally) until commit() is called.
IBriteDatabase
Database to send sql commands, created during openDatabase
OpenDatabaseOptions
Options for opening the database see openDatabase for details
Sqflite
sqflite plugin
SqfliteOptions
internal options. [...]
Transaction
Database transaction to use during a transaction

Extensions

MapToListQueryStreamExtensions
Transform Query to list of values. Stream<Query> to Stream<List<T>>.
MapToOneOrDefaultQueryStreamExtensions
Transform Query to single value. Stream<Query> to Stream<T>.
MapToOneQueryStreamExtensions
Transform Query to single value

Constants

inMemoryDatabasePath → const String
Special database name opened in memory
':memory:'

Properties

databaseFactory DatabaseFactory
sqflite Default factory
read / write
onDatabaseDowngradeDelete OnDatabaseVersionChangeFn
Downgrading will delete the database and open it again. [...]
final
sqfliteLogLevelNone int
No logs
final
sqfliteLogLevelSql int
Log native sql commands
final
sqfliteLogLevelVerbose int
Log native verbose
final

Functions

databaseExists(String path) Future<bool>
Check if a database exists at a given path.
deleteDatabase(String path) Future<void>
Delete the database at the given path.
getDatabasesPath() Future<String>
Get the default databases location. [...]
onDatabaseVersionChangeError(Database db, int oldVersion, int newVersion) Future<void>
to specify during openDatabase for onDowngrade Downgrading will always fail
openDatabase(String path, {int? version, OnDatabaseConfigureFn? onConfigure, OnDatabaseCreateFn? onCreate, OnDatabaseVersionChangeFn? onUpgrade, OnDatabaseVersionChangeFn? onDowngrade, OnDatabaseOpenFn? onOpen, bool readOnly = false, bool singleInstance = true}) Future<Database>
Open the database at a given path [...]
openReadOnlyDatabase(String path) Future<Database>
Open the database at a given path in read only mode

Enums

ConflictAlgorithm
Insert/Update conflict resolver

Typedefs

BriteDatabaseLogger = void Function(String message)
Logs changed tables or sent query.
JSON = Map<String, dynamic>
JSON Object
OnDatabaseConfigureFn = FutureOr<void> Function(Database db)
Prototype of the function called before calling onCreate/onUpdate/onOpen when the database is open. [...]
OnDatabaseCreateFn = FutureOr<void> Function(Database db, int version)
Prototype of the function called when the database is created. [...]
OnDatabaseOpenFn = FutureOr<void> Function(Database db)
Prototype of the function called when the database is open. [...]
OnDatabaseVersionChangeFn = FutureOr<void> Function(Database db, int oldVersion, int newVersion)
Prototype of the function called when the version has changed. [...]
Query = Future<List<JSON>> Function()
Lazy query. [...]

Exceptions / Errors

DatabaseException
Wrap sqlite native exception