Client class API

API Client to the remote Thread daemon

final client = threads.Client();
final dbId = 'bafk7ayo2xuuafgx6ubbcn2lro3s7oixgujdda6shv4';
await client.newDB(dbId);

Constructors

Client({Config config})
Create a new Client with given config

Properties

hashCode → int
The hash code for this object. [...]
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited

Methods

create(String dbID, String collectionName, List<Map<String, dynamic>> values) → Future<List<String>>
Create a new instance(s) in the collection [...]
createListener(String dbID) → Stream<ListenResult>
Create an update stream
delete(String dbID, String collectionName, List<String> instanceIDs) → Future<void>
Delete an existing instance
find(String dbID, String collectionName, Query query) → Future<List<Map<String, dynamic>>>
Find any matching instance IDs by query
findById(String dbID, String collectionName, String instanceID) → Future<Map<String, dynamic>>
Find and return an instance by ID
getDBInfo(String dbID) → Future<Info>
Get the DB's address & key information
has(String dbID, String collectionName, List<String> instanceIDs) → Future<bool>
Check if an instance exists in the given collection
newCollection({String dbID, String name, String schema}) → Future<void>
Create a new collection in the DB
newDB(String dbID) → Future<void>
Create a new DB with provided Credentials [...]
newDBFromAddr({String address, String key, List<Collection> collections}) → Future<void>
Join a DB from a remote address
readTransaction(StreamController<GeneratedMessage> writer) → ResponseStream<ReadTransactionReply>
Create a read transaction steam
save(String dbID, String collectionName, List<Map<String, dynamic>> values) → Future<void>
Save changes to an existing instance
shutdown() → Future<void>
Shut down the connection
writeTransaction(StreamController<GeneratedMessage> writer) → ResponseStream<WriteTransactionReply>
Create a write transaction stream
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() → String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) → bool
The equality operator. [...]
inherited