stormberry 0.6.1 copy "stormberry: ^0.6.1" to clipboard
stormberry: ^0.6.1 copied to clipboard

outdated

Access your postgres database effortlessly from dart code.

example/lib/main.dart

import 'package:stormberry/stormberry.dart';

import 'models.dart';

Future<void> main() async {
  var db = Database(
    port: 2222,
    database: 'dart_test',
    user: 'postgres',
    password: 'postgres',
    useSSL: false,
  );

  db.debugPrint = true;

  await db.accounts.insertOne(AccountInsertRequest(
    id: '123',
    firstName: 'Test',
    lastName: 'User',
    location: LatLng(1, 2),
    billingAddress: BillingAddress(name: 'Test User', street: 'SomeRoad 1', city: 'New York', postcode: '123'),
    companyId: 'abc',
  ));

  await db.companies.insertOne(CompanyInsertRequest(
    id: 'abc',
    name: 'Minga',
    addresses: [],
  ));

  var account = await db.accounts.queryUserView('123');

  print(account!.id);

  var company = await db.companies.queryAdminView('abc');

  print(company!.id);

  await db.close();
}
112
likes
0
pub points
77%
popularity

Publisher

verified publisherschultek.de

Access your postgres database effortlessly from dart code.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

analyzer, build, collection, crypto, dart_style, postgres, source_gen, yaml

More

Packages that depend on stormberry