{"id":19551790,"url":"https://github.com/leapfrogtechnology/sync-db","last_synced_at":"2026-02-05T12:07:26.902Z","repository":{"id":35052432,"uuid":"199813388","full_name":"leapfrogtechnology/sync-db","owner":"leapfrogtechnology","description":"Utility to synchronize relational database objects across databases.","archived":false,"fork":false,"pushed_at":"2026-01-30T17:27:07.000Z","size":3206,"stargazers_count":34,"open_issues_count":10,"forks_count":15,"subscribers_count":11,"default_branch":"master","last_synced_at":"2026-01-30T18:55:29.230Z","etag":null,"topics":["cli","database","database-migrations","database-objects","db","hacktoberfest","migrations","sql","sync"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@leapfrogtechnology/sync-db","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leapfrogtechnology.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-07-31T08:26:57.000Z","updated_at":"2025-11-27T09:31:59.000Z","dependencies_parsed_at":"2023-09-29T08:33:41.435Z","dependency_job_id":"f170fc7f-27a7-4a17-8bc1-02f6cf05ec3e","html_url":"https://github.com/leapfrogtechnology/sync-db","commit_stats":{"total_commits":877,"total_committers":17,"mean_commits":"51.588235294117645","dds":"0.49030786773090085","last_synced_commit":"3b93c8d591d3f25de3595f4aa1ddb1bf3e152682"},"previous_names":[],"tags_count":46,"template":false,"template_full_name":null,"purl":"pkg:github/leapfrogtechnology/sync-db","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leapfrogtechnology%2Fsync-db","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leapfrogtechnology%2Fsync-db/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leapfrogtechnology%2Fsync-db/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leapfrogtechnology%2Fsync-db/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leapfrogtechnology","download_url":"https://codeload.github.com/leapfrogtechnology/sync-db/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leapfrogtechnology%2Fsync-db/sbom","scorecard":{"id":582036,"data":{"date":"2025-08-11","repo":{"name":"github.com/leapfrogtechnology/sync-db","commit":"0562feffb65d5d564c550dba218de3ace73e096a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.4,"checks":[{"name":"Code-Review","score":5,"reason":"Found 1/2 approved changesets -- score normalized to 5","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":6,"reason":"8 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 6","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'actions' permission set to 'read': .github/workflows/codeql.yml:17","Info: jobLevel 'contents' permission set to 'read': .github/workflows/codeql.yml:18","Warn: no topLevel permission defined: .github/workflows/build-publish.yml:1","Warn: no topLevel permission defined: .github/workflows/codeql.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build-publish.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/leapfrogtechnology/sync-db/build-publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build-publish.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/leapfrogtechnology/sync-db/build-publish.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build-publish.yml:50: update your workflow using https://app.stepsecurity.io/secureworkflow/leapfrogtechnology/sync-db/build-publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build-publish.yml:67: update your workflow using https://app.stepsecurity.io/secureworkflow/leapfrogtechnology/sync-db/build-publish.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build-publish.yml:77: update your workflow using https://app.stepsecurity.io/secureworkflow/leapfrogtechnology/sync-db/build-publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build-publish.yml:86: update your workflow using https://app.stepsecurity.io/secureworkflow/leapfrogtechnology/sync-db/build-publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/leapfrogtechnology/sync-db/codeql.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql.yml:32: update your workflow using https://app.stepsecurity.io/secureworkflow/leapfrogtechnology/sync-db/codeql.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql.yml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/leapfrogtechnology/sync-db/codeql.yml/master?enable=pin","Warn: containerImage not pinned by hash: examples/node-app-mssql-ts/Dockerfile:1: pin your Docker image by updating node:18-slim to node:18-slim@sha256:f9ab18e354e6855ae56ef2b290dd225c1e51a564f87584b9bd21dd651838830e","Warn: containerImage not pinned by hash: examples/node-app-mssql/Dockerfile:1: pin your Docker image by updating node:18-slim to node:18-slim@sha256:f9ab18e354e6855ae56ef2b290dd225c1e51a564f87584b9bd21dd651838830e","Warn: containerImage not pinned by hash: examples/node-mssql-programmatic-use/Dockerfile:1: pin your Docker image by updating node:18-slim to node:18-slim@sha256:f9ab18e354e6855ae56ef2b290dd225c1e51a564f87584b9bd21dd651838830e","Info:   0 out of   7 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned","Info:   0 out of   3 containerImage dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":8,"reason":"SAST tool detected but not run on all commits","details":["Info: SAST configuration detected: CodeQL","Warn: 15 commits out of 29 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"11 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-m5vv-6r4h-3vj9","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-76p7-773f-r4q5"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-20T19:26:01.785Z","repository_id":35052432,"created_at":"2025-08-20T19:26:01.786Z","updated_at":"2025-08-20T19:26:01.786Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29121685,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-05T10:47:47.471Z","status":"ssl_error","status_checked_at":"2026-02-05T10:45:08.119Z","response_time":65,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","database","database-migrations","database-objects","db","hacktoberfest","migrations","sql","sync"],"created_at":"2024-11-11T04:15:04.532Z","updated_at":"2026-02-05T12:07:26.889Z","avatar_url":"https://github.com/leapfrogtechnology.png","language":"TypeScript","readme":"# sync-db\n\nCommand line utility to synchronize and version control relational database objects across databases.\n\n[![Version](https://img.shields.io/npm/v/@leapfrogtechnology/sync-db.svg?style=flat-square)](https://npmjs.org/package/@leapfrogtechnology/sync-db)\n[![Travis](https://img.shields.io/travis/com/leapfrogtechnology/sync-db.svg?style=flat-square)](https://travis-ci.com/leapfrogtechnology/sync-db)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://github.com/leapfrogtechnology/sync-db#contributing)\n[![LICENSE](https://img.shields.io/github/license/leapfrogtechnology/sync-db.svg?style=flat-square)](https://github.com/leapfrogtechnology/sync-db/blob/master/LICENSE)\n\n## Installation\n\n**Using npm:**\n\n```bash\n$ npm install @leapfrogtechnology/sync-db\n```\n\nYou can install it **globally** as well.\n\n```bash\n$ npm install -g @leapfrogtechnology/sync-db\n```\n\n### Drivers Installation\n\nYou'll need to install the database driver specific to your project separately.\n\nFor instance - if your project uses MSSQL, you will need to do:\n\n```\n$ yarn add mssql\n```\n\nThis utility uses [Knex](http://knexjs.org/) under the hood so these are the [supported drivers](http://knexjs.org/#Installation-node).\n\n## Usage\n\nYou can use `sync-db` both as a CLI utility and programmatically.\n\n\u003c!-- usage --\u003e\n\n```sh-session\n$ npm install -g @leapfrogtechnology/sync-db\n$ sync-db COMMAND\nrunning command...\n$ sync-db (-v|--version|version)\n@leapfrogtechnology/sync-db/2.3.0 linux-x64 node-v22.22.0\n$ sync-db --help [COMMAND]\nUSAGE\n  $ sync-db COMMAND\n...\n```\n\n\u003c!-- usagestop --\u003e\n\n## Commands\n\nWhen installed globally, you can invoke the CLI directly.\n\nThe CLI exposes a single command `sync-db` that runs synchronize operation based on your [configuration](#configuration).\n\n\u003c!-- commands --\u003e\n\n- [`sync-db`](#sync-db-)\n- [`sync-db help [COMMAND]`](#sync-db-help-command)\n- [`sync-db make NAME`](#sync-db-make-name)\n- [`sync-db make-publish`](#sync-db-make-publish)\n- [`sync-db migrate-latest`](#sync-db-migrate-latest)\n- [`sync-db migrate-list`](#sync-db-migrate-list)\n- [`sync-db migrate-rollback`](#sync-db-migrate-rollback)\n- [`sync-db prune`](#sync-db-prune)\n- [`sync-db synchronize`](#sync-db-synchronize)\n\n## `sync-db`\n\n```\nUSAGE\n  $ sync-db\n```\n\n_See code: [src/commands/index.ts](https://github.com/leapfrogtechnology/sync-db/blob/v2.3.0/src/commands/index.ts)_\n\n## `sync-db help [COMMAND]`\n\ndisplay help for sync-db\n\n```\nUSAGE\n  $ sync-db help [COMMAND]\n\nARGUMENTS\n  COMMAND  command to show help for\n\nOPTIONS\n  --all  see all commands in CLI\n```\n\n_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v3.2.2/src/commands/help.ts)_\n\n## `sync-db make NAME`\n\nMake migration files from the template.\n\n```\nUSAGE\n  $ sync-db make NAME\n\nARGUMENTS\n  NAME  Object or filename to generate.\n\nOPTIONS\n  -c, --config=config        Custom configuration file.\n  -t, --type=TYPE            [default: migration] Type of file to generate.\n  --create                   Generate create table stub.\n  --object-name=object-name  Name of table/view/routine to migrate.\n```\n\n_See code: [src/commands/make.ts](https://github.com/leapfrogtechnology/sync-db/blob/v2.3.0/src/commands/make.ts)_\n\n## `sync-db make-publish`\n\nPublish migration templates files.\n\n```\nUSAGE\n  $ sync-db make-publish\n\nOPTIONS\n  -c, --config=config  Custom configuration file.\n```\n\n_See code: [src/commands/make-publish.ts](https://github.com/leapfrogtechnology/sync-db/blob/v2.3.0/src/commands/make-publish.ts)_\n\n## `sync-db migrate-latest`\n\nRun the migrations up to the latest changes.\n\n```\nUSAGE\n  $ sync-db migrate-latest\n\nOPTIONS\n  -c, --config=config         Custom configuration file.\n  --connection-resolver=PATH  Path to the connection resolver.\n  --dry-run                   Dry run migration.\n  --only=CONNECTION_ID(s)     Filter provided connection(s). Comma separated ids eg: id1,id2\n```\n\n_See code: [src/commands/migrate-latest.ts](https://github.com/leapfrogtechnology/sync-db/blob/v2.3.0/src/commands/migrate-latest.ts)_\n\n## `sync-db migrate-list`\n\nList all the migrations.\n\n```\nUSAGE\n  $ sync-db migrate-list\n\nOPTIONS\n  -c, --config=config         Custom configuration file.\n  --connection-resolver=PATH  Path to the connection resolver.\n  --only=CONNECTION_ID(s)     Filter provided connection(s). Comma separated ids eg: id1,id2\n```\n\n_See code: [src/commands/migrate-list.ts](https://github.com/leapfrogtechnology/sync-db/blob/v2.3.0/src/commands/migrate-list.ts)_\n\n## `sync-db migrate-rollback`\n\nRollback migrations up to the last run batch.\n\n```\nUSAGE\n  $ sync-db migrate-rollback\n\nOPTIONS\n  -c, --config=config         Custom configuration file.\n  --connection-resolver=PATH  Path to the connection resolver.\n  --dry-run                   Dry run rollback.\n  --only=CONNECTION_ID(s)     Filter provided connection(s). Comma separated ids eg: id1,id2\n```\n\n_See code: [src/commands/migrate-rollback.ts](https://github.com/leapfrogtechnology/sync-db/blob/v2.3.0/src/commands/migrate-rollback.ts)_\n\n## `sync-db prune`\n\nDrop all the synchronized db objects except the ones created via migrations.\n\n```\nUSAGE\n  $ sync-db prune\n\nOPTIONS\n  -c, --config=config         Custom configuration file.\n  --connection-resolver=PATH  Path to the connection resolver.\n  --dry-run                   Dry run prune.\n  --only=CONNECTION_ID(s)     Filter provided connection(s). Comma separated ids eg: id1,id2\n```\n\n_See code: [src/commands/prune.ts](https://github.com/leapfrogtechnology/sync-db/blob/v2.3.0/src/commands/prune.ts)_\n\n## `sync-db synchronize`\n\nSynchronize all the configured database connections.\n\n```\nUSAGE\n  $ sync-db synchronize\n\nOPTIONS\n  -c, --config=config         Custom configuration file.\n  -f, --force                 Force synchronization.\n  --connection-resolver=PATH  Path to the connection resolver.\n  --dry-run                   Dry run synchronization.\n  --only=CONNECTION_ID(s)     Filter provided connection(s). Comma separated ids eg: id1,id2\n  --skip-migration            Skip running migrations.\n\n  --sync-files=FILE_PATH(s)   Comma separated relative file paths to sync. When provided, skips teardown and only syncs\n                              specified files.\n```\n\n_See code: [src/commands/synchronize.ts](https://github.com/leapfrogtechnology/sync-db/blob/v2.3.0/src/commands/synchronize.ts)_\n\n\u003c!-- commandsstop --\u003e\n\nRefer to the [examples](#examples) section below for full example with CLI usage.\n\n## Programmatic Usage\n\nYou may use programmatic API as shown below in case you need better flexibility based on your needs.\n\n```ts\nimport { synchronize, loadConfig, resolveConnections } from '@leapfrogtechnology/sync-db';\n\n(async () =\u003e {\n  const config = await loadConfig(); // Load sync-db.yml\n  const connections = await resolveConnections(); // Load connections.sync-db.json\n\n  // Invoke the command.\n  await synchronize(config, connections);\n})();\n```\n\nYou can also pass your own database connection (eg: Knex connection) instead of resolving `connections.sync-db.json` file.\n\n```ts\nimport { knex } from 'knex';\nimport { synchronize, loadConfig } from '@leapfrogtechnology/sync-db';\n\n(async () =\u003e {\n  const config = await loadConfig(); // Load sync-db.yml\n  const connection = knex({\n    // Your Knex connection instance.\n    client: 'mssql',\n    connection: {\n      host: 'host',\n      user: 'userName',\n      password: 'password',\n      database: 'dbName'\n    }\n  });\n  const options = {\n    force: false,\n    'skip-migration': false,\n    'sync-files': ['functions/dbo/fn_calculate.sql', 'views/dbo/vw_summary.sql'] // Optional: partial sync\n  };\n\n  // Invoke the command.\n  await synchronize(config, connection, options);\n})();\n```\n\n## Configuration\n\n1. [Sync Configuration](#1-sync-configuration)\n2. [Database Connections](#2-database-connections)\n\n### 1. Sync Configuration\n\nsync-db expects the configuration file `sync-db.yml` to be present in your working directory. This holds all your configurations.\n\n**sync-db.yml**\n\n```yml\n# Base path for the SQL source files.\nbasePath: /path/to/sql\n\nsql:\n  - schema/\u003cschema_name\u003e.sql\n  - function/\u003cschema_name\u003e/\u003cfunction_name\u003e.sql.drop # While synchronizing this will only be dropped, not synced.\n  - procedure/\u003cschema_name\u003e/\u003cprocedure_name\u003e.sql\n```\n\n#### Configuration Options\n\n- **`basePath`** `(string)` - Base directory to hold all your SQL \u0026 migrations codebase (default: \"src\").\n- **`sql`** `(array)` - A series of SQL file paths that are to be run in ordered sequence (top to bottom), based on dependency. It should be noted that the source files needs to follow this convention of [directory hierarchy](docs/sql.md).\n  File paths listed here are relative to `${basePath}/sql` value.\n- **`migration`** `(array)` - Migrations specific configurations.\n\n  - **`sourceType`** `(string)` - Type of migration file. Value `defaults` to sql. - **example**: javascript, typescript.\n  - **`tableName`** `(string)` - Custom name for table to store migrations meta data.\n\n- **`connectionResolver`** (`string`) - Connection resolver file name optional if connections are resolved using `connections.sync-db.json`.\n\n### 2. Database Connections\n\nDatabase connections are configured in `connections.sync-db.json` file in your project root directory as shown below.\n\nSince it contains all your database credentials, it is recommended that you **DO NOT COMMIT** it to VCS.\n\n**connections.sync-db.json**\n\n```json\n{\n  \"connections\": [\n    {\n      \"id\": \"db1\",\n      \"host\": \"localhost\",\n      \"port\": 1433,\n      \"user\": \"db1user\",\n      \"database\": \"db1\",\n      \"password\": \"password\",\n      \"client\": \"mssql\"\n    }\n  ]\n}\n```\n\nNote: The `connections` key expects an array, so you can also provide multiple databases and `sync-db` ensures your configured db objects are synced across all these databases.\n\nConnection using **connection-resolver.js**\n\nFile consists a `resolve` function which returns an array of connections to the databases. Add the resolver file name to **`connectionResolver`** field in sync-db.yml.\n\n#### Caveat\n\nSetup and Teardown steps aren't always run within a single transaction. **You need to pass the transaction instance object explicitly to make sure this happens.**\n\n```js\nawait db.transaction(async trx =\u003e {\n  // Rollback and create all db objects using config.\n  await synchronize(config, trx);\n});\n```\n\n## Examples\n\n1. [Node MSSQL JavaScript Sample](examples/node-app-mssql)\n2. [Node MSSQL TypeScript Sample](examples/node-app-mssql-ts)\n3. [Node MSSQL Programmatic Usage Sample](examples/node-mssql-programmatic-use)\n4. [Node PostgreSQL JavaScript Sample](examples/node-app-pg)\n5. [Node PostgreSQL TypeScript Sample](examples/node-app-pg-ts)\n\n## Changelog\n\nCheck the [CHANGELOG](CHANGELOG.md) for release history.\n\n## Contributing\n\nFeel free to send pull requests.\n\n## Development\n\n#### Setting up\n\n```bash\n# Clone the repository.\n$ git clone https://github.com/leapfrogtechnology/sync-db.git\n\n# Go to the project directory.\n$ cd sync-db\n\n# Install dependencies. (Notice that we use yarn for this.)\n$ yarn\n```\n\n#### Building / Testing\n\n```bash\n# Generate build.\n$ yarn build\n\n# Run tests\n$ yarn test\n\n# Invoke the CLI locally (development mode).\n$ bin/run-dev.sh\n```\n\n#### Release\n\nPublish a new version.\n\nCreate a PR updating **version** in package.json to master.\n\n## License\n\nLicensed under [The MIT License](LICENSE).\n\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fleapfrogtechnology%2Fsync-db.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fleapfrogtechnology%2Fsync-db?ref=badge_large)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleapfrogtechnology%2Fsync-db","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleapfrogtechnology%2Fsync-db","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleapfrogtechnology%2Fsync-db/lists"}