-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
The migrate private function currently requires that the given database be strictly implemented as duct.database.sql, so that a migratable store may be created against it.
Ragtime itself is agnostic to the type of datastore migrations are run against, provided the proper protocols are implemented.
It would be handy if migrator.ragtime could accept different, non-sql database configuration, that may still have coherent notions of migrations, e.g. MongoDB (as though via duct-mongodb).
A few possible approaches:
- Define a
->DataStoreprotocol, which defines a singleget-databasemethod that will return the appropriate object implementing theDataStoreprotocol, whichmigratecan call in lieu of its current private function.migrator.ragtimecan include a defaulted extension of this protocol againstduct.database.sql.Boundary. Other clients can define their own. It would probably be most appropriate to declare such a protocol (without implementation) inragtime/protocols, and then provide the default implementation forduct.database.sql.Boundaryinmigrator.ragtime. - Add a
:get-datastore-fnto themigrator.ragtimeconfig, applied in lieu of the current private function, which would be a client-defined function that similarly take the given database spec and returns a migratableDataStore. - Add a
:migration-datastorekey to the config, which takes a value of an object implementing theDataStoreprotocol, in lieu of using the:databaseand:migrations-tablekeys. This might be the cleanest option.
Thoughts on either of these approaches? Is there one you'd prefer and be open to receiving a PR for?
Metadata
Metadata
Assignees
Labels
No labels