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, List<String>? namespace}) Future<void>
Add new columns to an existing table.
addColumnWithExpression({required String table, required Map<String, String> newColumns, List<String>? namespace}) Future<void>
Add new columns to an existing table.
checkout({required String table, required int version, List<String>? namespace}) Future<void>
Checkout a version of a table (will put the table in a read only mode)
count({required String table, String? text, List<double>? vector, dynamic where, List<String>? namespace}) Future<int>
Count records in a table.
createFullTextSearchIndex({required String table, required String column, List<String>? namespace, bool replace = false}) Future<void>
Create a full-text search index on a given text column.
createScalarIndex({required String table, required String column, List<String>? namespace, bool replace = false}) Future<void>
Create a scalar index on a given column.
createTableFromData({required String name, required List<Map<String, dynamic>> data, CreateMode mode = CreateMode.create, List<String>? namespace, Map<String, dynamic>? metadata}) 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, List<String>? namespace, Map<String, dynamic>? metadata}) Future<void>
Create a new table with a specific schema.
createVectorIndex({required String table, required String column, List<String>? namespace, bool replace = false}) Future<void>
Create a vector index on a given column.
delete({required String table, required String where, List<String>? namespace}) Future<void>
Delete records from a table.
dropColumns({required String table, required List<String> columns, List<String>? namespace}) Future<void>
Drop columns from an existing table.
dropIndex({required String table, required String name, List<String>? namespace}) Future<void>
Drop columns from an existing table.
dropTable({required String name, bool ignoreMissing = false, List<String>? namespace}) Future<void>
Drop (delete) a table by name.
insert({required String table, required List<Map<String, dynamic>> records, List<String>? namespace}) Future<void>
Insert new records into a table.
inspect(String table, {List<String>? namespace}) Future<Map<String, DataType>>
Restore a previous version of a table
listIndexes(String table, {List<String>? namespace}) Future<List<TableIndex>>
List all indexes on a table.
listTables({List<String>? namespace}) Future<List<String>>
List all tables in the database. @returns A future resolving to an array of table names.
listVersions(String table, {List<String>? namespace}) Future<List<TableVersion>>
List versions of a table
merge({required String table, required String on, required List<Map<String, dynamic>> records, List<String>? namespace}) 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, List<String>? namespace}) Future<void>
Optimize (compact/prune) a table.
restore({required String table, required int version, List<String>? namespace}) Future<void>
Restore a previous version of a table
Search for records in a table.
sql({required String query, required List<TableRef> tables, Map<String, dynamic>? params}) Future<List<Map<String, dynamic>>>
Execute a SQL query against one or more tables.
toString() String
A string representation of this object.
inherited
update({required String table, required String where, Map<String, dynamic>? values, Map<String, String>? valuesSql, List<String>? namespace}) Future<void>
Update existing records in a table.

Operators

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