@queuert/mysql
MySQL and MariaDB state adapter.
$npm install @queuert/mysql
Functions2
Types7
- MigrationExperimentalOne migration. Migrations run in the order of their list, and name identifies a migration in the history table, so it must be unique and must not change once the migration has run.
- MigrationResultResult of a migration run: which migrations were skipped (already applied), applied, reverted, and unrecognized (present in the database but not in the code).
- MigrationScriptExperimentalA free-form migration script: the up and down of a non-transactional migration, and the migrator's before and after scripts. It runs outside a transaction and brings its own database access. Call assertLockHeld between steps of long work; it throws once the migration lease is lost, so the script stops before another process starts migrating.
- MigratorExperimentalRuns migrations, from createPgMigrator or createSqliteMigrator. Each call takes the migration lease first, so many processes can migrate on boot at once: one migrates, the others wait for it and then find nothing left to do. A migrator over a synchronous state provider, for the adapters that support one, has TMode "sync": it takes no lease and returns its results directly.
- MysqlErrorClassificationExperimentalThe classification of a driver error the MySQL state adapter acts on, as returned by MysqlStateProvider.classifyError.
- MysqlStateAdapterExperimentalMySQL and MariaDB state adapter type. Includes migrateToLatest for schema migrations.
- MysqlStateProviderExperimentalMySQL and MariaDB state provider interface.