athena_mysql 1.2.0 copy "athena_mysql: ^1.2.0" to clipboard
athena_mysql: ^1.2.0 copied to clipboard

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

example/main.dart

import 'package:athena_mysql/athena_mysql.dart';

void main(List<String> args) async {
  final athenaSql = await AthenaMySQL.open(const AthenaMySqlEndpoint(
      host: 'localgost',
      port: 3306,
      userName: 'userName',
      password: 'password'));

  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);
}
0
likes
160
points
55
downloads

Publisher

verified publisherathena-sql.dev

Weekly Downloads

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

Homepage
Repository (GitHub)

Topics

#sql #mysql

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

athena_sql, mysql_client, path

More

Packages that depend on athena_mysql