duhanbalci / surrealdb_flutter

SurrealDB client written in pure dart. auto reconnect, typed functions
MIT License
42 stars 9 forks source link

Using client.close() results in Unhandled Exception: ws not connected #1

Closed NomadMoto closed 2 years ago

NomadMoto commented 2 years ago

[VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: ws not connected

NomadMoto commented 2 years ago

Example function:

`void deleteUser() async {
  final client = SurrealDB('ws://localhost:8000/rpc');

  client.connect();
  await client.wait();
  await client.use('ns', 'db');
  await client.signin('root', 'root');

  final delete = await client.query('DELETE user:5');

  print(delete);
  client.close(); <------ line in question causing issue.
}`