datastore_dart 1.1.0 copy "datastore_dart: ^1.1.0" to clipboard
datastore_dart: ^1.1.0 copied to clipboard

Google Cloud Datastore driver for Dart. Inspired by mongo_dart.

example/main.dart

import 'package:datastore_dart/datastore_dart.dart';

Future main() async {
  // TODO: replace the credentials.
  var credentials = {
    'type': 'service_account',
    'project_id': '',
    'private_key_id': '',
    'private_key': '',
    'client_email': '',
    'client_id': '',
    'auth_uri': '',
    'token_uri': 'https://oauth2.googleapis.com/token',
    'auth_provider_x509_cert_url': 'https://www.googleapis.com/oauth2/v1/certs',
    'client_x509_cert_url': ''
  };

  var db = Db(credentials);
  var collection = db.collection('my_kind');

  // Insert entity
  await collection.insertOne({
    'name': 'Tom',
    'rating': 100,
  });

  // Query entity
  Map<String, dynamic>? result =
      await collection.findOne(where.eq('name', 'Tom').gt('rating', 10));
}
2
likes
140
pub points
0%
popularity

Publisher

verified publisheradrianjagielak.dev

Google Cloud Datastore driver for Dart. Inspired by mongo_dart.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

collection, googleapis, googleapis_auth, meta

More

Packages that depend on datastore_dart