DatabaseClient class

A client for interacting with the 'database' extension on the room server.

Constructors

DatabaseClient({required RoomClient room})
@param room The RoomClient used to send requests.

Properties

hashCode int
The hash code for this object.
no setterinherited
room RoomClient
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addColumnsOfType({required String table, required Map<String, DataType> newColumns}) Future<void>
Add new columns to an existing table.
addColumnWithExpression({required String table, required Map<String, String> newColumns}) Future<void>
Add new columns to an existing table.
checkout({required String table, required int version}) Future<void>
Checkout a version of a table (will put the table in a read only mode)
createFullTextSearchIndex({required String table, required String column}) Future<void>
Create a full-text search index on a given text column.
createScalarIndex({required String table, required String column}) Future<void>
Create a scalar index on a given column.
createTableFromData({required String name, required List<Map<String, dynamic>> data, CreateMode mode = CreateMode.create}) Future<void>
Create a table from initial data, optionally specifying a mode.
createTableWithSchema({required String name, required Map<String, DataType> schema, CreateMode mode = CreateMode.create}) Future<void>
Create a new table with a specific schema.
createVectorIndex({required String table, required String column}) Future<void>
Create a vector index on a given column.
delete({required String table, required String where}) Future<void>
Delete records from a table.
dropColumns({required String table, required List<String> columns}) Future<void>
Drop columns from an existing table.
dropIndex({required String table, required String name}) Future<void>
Drop columns from an existing table.
dropTable({required String name, bool ignoreMissing = false}) Future<void>
Drop (delete) a table by name.
insert({required String table, required List<Map<String, dynamic>> records}) Future<void>
Insert new records into a table.
inspect(String table) Future<Map<String, DataType>>
Restore a previous version of a table
listIndexes(String table) Future<List<TableIndex>>
List all indexes on a table.
listTables() Future<List<String>>
List all tables in the database. @returns A future resolving to an array of table names.
listVersions(String table) Future<List<TableVersion>>
List versions of a table
merge({required String table, required String on, required List<Map<String, dynamic>> records}) Future<void>
Merge (upsert) records into a table.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
optimize({required String table}) Future<void>
Optimize (compact/prune) a table.
restore({required String table, required int version}) Future<void>
Restore a previous version of a table
Search for records in a table.
toString() String
A string representation of this object.
inherited
update({required String table, required String where, Map<String, dynamic>? values, Map<String, String>? valuesSql}) Future<void>
Update existing records in a table.

Operators

operator ==(Object other) bool
The equality operator.
inherited