iw_database 1.0.0 copy "iw_database: ^1.0.0" to clipboard
iw_database: ^1.0.0 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
0
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

License

unknown (license)

Dependencies

collection, mysql_client

More

Packages that depend on iw_database