dbapi_test_suite 0.1.0-alpha.8 copy "dbapi_test_suite: ^0.1.0-alpha.8" to clipboard
dbapi_test_suite: ^0.1.0-alpha.8 copied to clipboard

Test suite for dbapi backends

Test suite for the dbapi, a standardized interface abstracting database interaction, targeting both SQL and noSQL.

Getting started #

This library is intended for implementers of dbapi backends.

Start by implementing/extending the Connector abstract class. This will require you to implement a Connection class, which in turn will prompt the need for a Cursor.

Start by adding support for the AddCollection and Insert operations, as those are required by almost all other tests.

As soon as you have a minimal implementation, you can start running it against the test suite by using the ConnectorTestSuite.

import 'package:dbapi/test_suite.dart';
import 'package:your_backend/your_backend.dart';

class YourDatabaseTest with ConnectorTestSuite<YourDatabaseTest> {
  @override
  YourDatabaseConnector get connector => YourDatabaseConnector(...);
}

void main() {
  final testSuite = YourDatabaseTest();
  testSuite.runDatabaseTests();
}

Once you fixed all the tests for the "core" set of features, you can then gradually add more to your Connector.supportedFeatures set.

Additional information #

The test_suite is integral part of the API contract. If your database supports a feature but tests can pass you should document it clearly (and let us know, we might need to tweak the APIs!)

Contribution #

Contribution welcome, especially in the form of feedback on the API.

2
likes
120
points
14
downloads

Publisher

verified publisherakqaleap.com

Weekly Downloads

Test suite for dbapi backends

Repository (GitLab)
View/report issues

Topics

#sqlite #database #orm #query-builder

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

dbapi, test

More

Packages that depend on dbapi_test_suite