mysql5_client 0.4.0 copy "mysql5_client: ^0.4.0" to clipboard
mysql5_client: ^0.4.0 copied to clipboard

mysql5.x driver

mysql_client #

A mysql5.x library for Dart developers.

Usage #

A simple usage example:

import '../lib/mysql5_client.dart';

void main() async {
  Connection? connection;

  try {
    connection = await new ConnectionFactory()
        .connect("localhost", 3306, "root", "shit", "db_test");

    // please pre-insert row that id = 1
    var statement = await connection.prepareQuery("UPDATE stud SET name = ? WHERE id = 1");
    statement.setParameter(0, "fuck老天");
    var queryResult = await statement.executeQuery();
    print(queryResult.affectedRows);

    queryResult =
        await connection.executeQuery("SELECT * FROM stud WHERE id = 1");

    // rows
    while (true) {
      var next = await queryResult.next();
      if (!next) {
        break;
      }

      print("${queryResult.getNumValue(0)} : ${queryResult.getStringValue(1)}}");
    }
  } finally {
    await connection?.close();
  }
}

Features and bugs #

Please file feature requests and bugs at the issue tracker.

2
likes
75
pub points
0%
popularity

Publisher

unverified uploader

mysql5.x driver

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

crypto, decimal, pool

More

Packages that depend on mysql5_client