fx_dao library

Classes

BaseFilter
查询条件基类
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.
BatchInsert
CustomInsert
Dao
Database
Database to send sql commands, created during openDatabase
DatabaseExecutor
Common API for Database and Transaction to execute SQL commands
DatabaseFactory
Basic databases operations
DbMigration
DbStore
Filter
单个查询条件(支持 value 为 Query 子查询)
FilterGroup
条件分组(支持 AND/OR 嵌套)
FxDb
InsertParam
OpenDatabaseOptions
Options for opening the database see openDatabase for details
Order
排序条件
Po
Query
查询参数封装,支持多条件、排序、分页、分组、聚合、字段选择、子查询
QueryCursor
Cursor for query by page cursor.
SnowflakeIdGenerator
SqfliteSqlCommand
Sql command. internal only.
Transaction
Database transaction to use during a transaction
TransactionInsert
ValueDao<T extends Po>

Enums

ConflictAlgorithm
Insert/Update conflict resolver
Logic
逻辑运算符(用于分组)
QueryOp
查询操作符
SqliteSqlCommandType
Sql command type.

Constants

inMemoryDatabasePath → const String
Special database name opened in memory
onDatabaseDowngradeDelete → const OnDatabaseVersionChangeFn
Downgrading will delete the database and open it again.
sqfliteLogLevelNone → const int
No logs
sqfliteLogLevelSql → const int
Log native sql commands
sqfliteLogLevelVerbose → const int
Log native verbose

Functions

onDatabaseVersionChangeError(Database db, int oldVersion, int newVersion) Future<void>
to specify during openDatabase for OpenDatabaseOptions.onDowngrade Downgrading will always fail

Typedefs

Convertor<T> = T Function(dynamic data)
ConvertorList<T> = T Function(List data)
MigrationOperation = Future<void> Function(Database database)
OnDatabaseConfigureFn = FutureOr<void> Function(Database db)
Prototype of the function called before calling OpenDatabaseOptions.onCreate/OpenDatabaseOptions.onUpgrade/OpenDatabaseOptions.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.
SqfliteCursorRowCallback = FutureOr<bool> Function(Map<String, Object?> row)
Callback for iteration. Return false to stop.

Exceptions / Errors

DatabaseException
Wrap sqlite native exception