stem_sqlite 0.1.0-alpha.3
stem_sqlite: ^0.1.0-alpha.3 copied to clipboard
SQLite broker and result backend for Stem.
stem_sqlite #
SQLite broker and result backend implementations for the Stem runtime. Use it to embed Stem into single-node or desktop deployments without external infrastructure.
Install #
dart pub add stem_sqlite
Add the core runtime if you haven't already:
dart pub add stem
Usage #
import 'package:stem/stem.dart';
import 'package:stem_sqlite/stem_sqlite.dart';
Future<void> main() async {
final registry = SimpleTaskRegistry()
..register(FunctionTaskHandler(name: 'demo.sqlite', handler: print));
final broker = await SqliteBroker.open(
SqliteConnection.inMemory(), // or SqliteConnection.file('stem.db')
);
final backend = await SqliteResultBackend.open(
SqliteConnection.inMemory(),
);
final stem = Stem(broker: broker, backend: backend, registry: registry);
await stem.enqueue('demo.sqlite', args: {'name': 'Stem'});
}
Tests #
The package bundles compliance tests from stem_adapter_tests. Running
dart test
executes the shared broker and backend contract suites against the SQLite adapters.
Support #
Report issues or feature requests on the GitHub tracker. Commercial support is available via Buy Me A Coffee.