synor
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

Synor

Database Migration Library

Installation

# using yarn: 
yarn add synor
 
# using npm: 
npm install --save synor

Usage

const path = require('path')
const { Synor } = require('synor')
const { MySQLDatabaseEngine } = require('synor/lib/database/mysql')
const { FileSourceEngine } = require('synor/lib/source/file')
 
const synor = Synor({
  DatabaseEngine: MySQLDatabaseEngine,
  SourceEngine: FileSourceEngine,
  databaseUri: 'mysql://root:root@localhost:3306/synor',
  sourceUri: `file://${path.resolve('migrations')}`
})
 
const currentVersion = async () => {
  await synor.migrator.open()
  const version = await synor.migrator.version()
  console.log('version', version)
  await synor.migrator.close()
}
 
currentVersion().catch(err => {
  console.error(err)
  process.exit(1)
})

License

Licensed under the MIT License. Check the LICENSE file for details.

Readme

Keywords

Package Sidebar

Install

npm i synor

Weekly Downloads

0

Version

0.2.0

License

MIT

Unpacked Size

133 kB

Total Files

38

Last publish

Collaborators

  • muniftanjim