seshat_maat 0.1.0 copy "seshat_maat: ^0.1.0" to clipboard
seshat_maat: ^0.1.0 copied to clipboard

Wires the Seshat ORM into the Maat framework.

Seshat for Maat #

Seshat icon

Wires the seshat ORM into the Maat framework.

packages/maat (the HTTP framework) depends only on shelf, args and path — an API-only application must not be forced to resolve database drivers. This package is the glue: it depends on both maat and seshat and gives you one provider to register.

Usage #

import 'package:maat/maat.dart';
import 'package:seshat_maat/seshat_maat.dart';

final app = await Application.configure(basePath: Directory.current.path)
    .withConfig({
      'database': {
        'default': 'sqlite',
        'connections': {
          'sqlite': {'driver': 'sqlite', 'database': 'storage/app.sqlite'},
        },
      },
    })
    .withProviders([DatabaseServiceProvider.new])
    .create();

DatabaseServiceProvider.boot() reads config('database'), opens the connection named by database.default, installs it on the DB facade via DB.use(...), and binds it in the container so app.make<Connection>() resolves it too. An application with no database config boots normally with no connection.

Ships adapters for sqlite and pgsql. Register another driver (e.g. a third-party MySQL adapter) without editing this package:

DatabaseServiceProvider.extend('mysql', (config) async {
  return MySqlConnection.open(...);
});

Re-exports package:seshat/seshat.dart, package:seshat/sqlite.dart and package:seshat/postgres.dart, so DB, Schema, Migration, SqliteConnection and PostgresConnection all resolve from package:seshat_maat/seshat_maat.dart — one import instead of three.

0
likes
140
points
45
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Wires the Seshat ORM into the Maat framework.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

maat, path, seshat

More

Packages that depend on seshat_maat