surrealdb_client 0.1.0 copy "surrealdb_client: ^0.1.0" to clipboard
surrealdb_client: ^0.1.0 copied to clipboard

Experimental Dart support for SurrealDB - database, realtime API layer, and security permissions all-in-one.

example/surrealdb_client_example.dart

import 'package:surrealdb_client/surrealdb_client.dart';

void main() async {
  final client = SurrealClient(url: '');
  print(await client.signIn({'user': 'root', 'pass': 'root'}));
  print(await client.use('test', 'test'));
  print(await client.info());
  final article =
      await client.create('article', {'title': 'test client title'});
  print(
    await client.update(article['id'], {
      'title': 'Updated client title',
      'update': true,
    }),
  );
  print(
    await client.change(article['id'], {
      'title': 'Changed client title',
      'change': true,
    }),
  );
  print(
    await client.modify(article['id'], [
      {
        'op': 'replace',
        'path': '/title',
        'value': 'Modified client title',
      },
      {
        'op': 'add',
        'path': '/modify',
        'value': true,
      },
    ]),
  );
  print(await client.select('article'));
  await client.delete(article['id']);

  client.close();
}
6
likes
150
pub points
24%
popularity

Publisher

verified publisherwrbl.xyz

Experimental Dart support for SurrealDB - database, realtime API layer, and security permissions all-in-one.

Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

objectid

More

Packages that depend on surrealdb_client