athena_postgres 1.2.3 copy "athena_postgres: ^1.2.3" to clipboard
athena_postgres: ^1.2.3 copied to clipboard

Dart PostgreSQL query builder, expressive and user-friendly API to build and manage SQL queries in your Dart projects.

example/main.dart

import 'package:athena_postgres/athena_postgres.dart';

void main(List<String> args) async {
  final athenaSql = await AthenaPostgresql.open(const AthenaPostgresqlEndpoint(
    host: 'localhost',
    databaseName: 'postgres',
    username: 'postgres',
  ));

  await athenaSql.create
      .table('users')
      .column((t) => t.string('name'))
      .column((t) => t.string('email'))
      .column((t) => t.int_('age'))
      .run();
  await athenaSql.insert
      .into('users')
      .values({'name': 'juan', 'email': 'juan@example.com'}).run();

  final selected = await athenaSql
      .select(['name', 'email'])
      .from('users')
      .as('u')
      .where((w) => w['u.name'].noEq('@name'))
      .run(mapValues: {'name': 'juan'});
  print(selected);
}
2
likes
160
points
62
downloads

Publisher

verified publisherathena-sql.dev

Weekly Downloads

Dart PostgreSQL query builder, expressive and user-friendly API to build and manage SQL queries in your Dart projects.

Homepage
Repository (GitHub)

Topics

#sql #postgres

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

athena_sql, path, postgres

More

Packages that depend on athena_postgres