sync-db icon indicating copy to clipboard operation
sync-db copied to clipboard

Introduce new command to run manual scripts

Open samirsilwal opened this issue 1 year ago • 0 comments

Changes

  • Introduce new command run-script
  • Accepts --file as flag
  • Can be used to run manual scripts in JS/TS or SQL
  • For SQl, simply run the script present in the given file
  • For JS/TS, a function main is expected to be exported which gets knex connection and identifier as args. example
export async function main(conn: Knex.Transaction, id: string) {
  await conn.......

  log(`Completed script for ${id}`)
}
  • Other existing flags like --only -> to run script for specific connection and --dry-run -> to dry run the script works as usual
  • Update unit tests

Todo

  • Update readme
  • Add demo ss

samirsilwal avatar Jul 17 '24 11:07 samirsilwal