DatabaseProvider class abstract
数据库提供者抽象接口 / Database provider abstract interface
通过实现此接口,可以支持多种数据库类型(SQLite、Hive、Isar等) By implementing this interface, multiple database types can be supported (SQLite, Hive, Isar, etc.)
实现示例 / Implementation example:
class MyCustomDatabaseProvider implements DatabaseProvider {
@override
String get name => 'CustomDB';
@override
Future<List<DatabaseInfo>> getDatabases() async {
// 返回数据库列表 / Return database list
return [];
}
@override
Future<QueryResult> queryTable(String dbPath, String tableName, {int limit = 50}) async {
// 执行查询并返回结果 / Execute query and return result
return QueryResult(columns: [], rows: []);
}
}
- Implementers
Constructors
Properties
Methods
-
getDatabases(
) → Future< List< DatabaseInfo> > - 获取所有数据库列表 / Get all database list
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
queryTable(
String dbPath, String tableName, {int limit = 50, int offset = 0, String? orderBy, bool desc = false, String? whereKeyword}) → Future< QueryResult> -
查询指定表的数据 / Query specified table data
dbPath数据库文件路径 / Database file pathtableName表名称 / Table namelimit返回行数限制,默认50 / Return row limit, default 50offset跳过的行数,用于分页 / Rows to skip, for paginationorderBy排序列名(列名白名单校验)/ Order-by column (validated against actual columns)desc是否降序 / Descending order when truewhereKeyword单元格级关键字过滤(任一列包含即匹配)/ Cell-level keyword filter -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited