iw_database 1.0.1 copy "iw_database: ^1.0.1" to clipboard
iw_database: ^1.0.1 copied to clipboard

This project is an implementation that allow developers to encapsulate their own usage of database clients.

example/example.dart

import 'dart:io';

import 'package:iw_database/iw_database.dart';

Future<void> main() async {
  try {
    final DatabaseProperties properties = DatabaseProperties(
      host: 'localhost',
      port: 3306,
      name: 'tests',
      username: 'root',
      password: 'wrah-baft-krup-cex-TEEH',
    );

    final DatabaseClientService service = MySQLDatabaseClientService(
      properties: properties,
    );

    await service.openConnection();

    final results = await service.executeQuery(
      sql: 'SELECT id, name FROM test_table WHERE id > :id',
      parameters: {
        'id': 5,
      },
    );

    print(results);

    await service.closeConnection();

    exit(0);
  } on DatabaseException catch (error) {
    print(error);
    exit(-1);
  }
}
1
likes
160
pub points
29%
popularity

Publisher

verified publisherivanwilhelm.dev

This project is an implementation that allow developers to encapsulate their own usage of database clients.

Repository (GitHub)
View/report issues

Topics

#database #mysql

Documentation

API reference

License

MIT (license)

Dependencies

collection, mysql_client

More

Packages that depend on iw_database