{"id":22940517,"url":"https://github.com/sandergi/sqlite-auto-migrator","last_synced_at":"2025-08-12T20:31:51.124Z","repository":{"id":228742269,"uuid":"711378939","full_name":"SanderGi/sqlite-auto-migrator","owner":"SanderGi","description":"Simple, flexible and automated SQLite database migration library","archived":false,"fork":false,"pushed_at":"2025-05-17T21:05:57.000Z","size":723,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-02T23:08:08.881Z","etag":null,"topics":["migration-automation","sqlite3"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/sqlite-auto-migrator","language":"JavaScript","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/SanderGi.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2023-10-29T04:22:55.000Z","updated_at":"2025-05-18T10:25:09.000Z","dependencies_parsed_at":"2024-03-30T06:23:01.507Z","dependency_job_id":"c00a20b1-7d7b-4982-99d3-4b80dc60feda","html_url":"https://github.com/SanderGi/sqlite-auto-migrator","commit_stats":{"total_commits":31,"total_committers":2,"mean_commits":15.5,"dds":"0.032258064516129004","last_synced_commit":"4ec440b286c9133a4e3caa162f47b93c27f6d21c"},"previous_names":["sandergi/sqlite-auto-migrator"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SanderGi/sqlite-auto-migrator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SanderGi%2Fsqlite-auto-migrator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SanderGi%2Fsqlite-auto-migrator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SanderGi%2Fsqlite-auto-migrator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SanderGi%2Fsqlite-auto-migrator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SanderGi","download_url":"https://codeload.github.com/SanderGi/sqlite-auto-migrator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SanderGi%2Fsqlite-auto-migrator/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270132224,"owners_count":24532746,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-12T02:00:09.011Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["migration-automation","sqlite3"],"created_at":"2024-12-14T13:22:50.634Z","updated_at":"2025-08-12T20:31:51.087Z","avatar_url":"https://github.com/SanderGi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sqlite-auto-migrator\n\n[![LOC](./.badges/lines-of-code.svg)](./.badges/lines-of-code.svg)\n[![FileCount](./.badges/file-count.svg)](./.badges/file-count.svg)\n[![Tests](./.badges/tests.svg)](./.badges/tests.svg)\n[![Coverage](./.badges/coverage.svg)](./.badges/coverage.svg)\n[![maintenance-status](https://img.shields.io/badge/maintenance-passively--maintained-yellowgreen.svg)](https://gist.github.com/taiki-e/ad73eaea17e2e0372efb76ef6b38f17b)\n[![NPM Installs](https://img.shields.io/npm/dy/sqlite-auto-migrator?label=Installs)](https://www.npmjs.com/package/sqlite-auto-migrator)\n[![NPM Version](https://img.shields.io/npm/v/sqlite-auto-migrator)](https://www.npmjs.com/package/sqlite-auto-migrator)\n\nSimple automated SQLite database migration library which works well with CI/CD pipelines and VCS.\n\nFlexible JavaScript-based migration files that can be auto-generated and applied directly via JavaScript or TypeScript:\n\n```js\nimport { Migrator } from 'sqlite-auto-migrator';\nconst migrator = new Migrator();\n\nawait migrator.make();\nawait migrator.migrate();\n```\n\nWorks from the command line too:\n\n```console\n$ sam make\n$ sam migrate\n```\n\n## Installation\n\nThis is a [Node.js](https://nodejs.org/en/) module available through the\n[npm registry](https://www.npmjs.com/). [Node.js v18.17.0](https://nodejs.org/en/download/) or higher is recommended.\n\nInstallation is done using the\n[`npm install`](https://docs.npmjs.com/getting-started/installing-npm-packages-locally) command:\n\n```console\n$ npm install sqlite-auto-migrator\n```\n\nThe library is also compatible with [Bun](https://bun.sh/), will use Bun's built-in SQLite library if available, and supports embedded files via `bun build --compile`:\n\n```console\n$ bun add sqlite-auto-migrator\n```\n\n## Usage\n\nWhen dealing with synchronizing database state between production, local development and more, you have two things to keep track of: the schema file that contains the desired database state and the database schema state itself.\n\n### Configuration\n\nFirst specify the path to the schema file with the `SAM_SCHEMA_PATH` environment variable and the path to the database file with `SAM_DB_PATH`. You can set them when running `node` or `sam`:\n\n```console\n$ SAM_SCHEMA_PATH=./schema.sql SAM_DB_PATH=./data.db node your_script.js\n$ SAM_SCHEMA_PATH=./schema.sql SAM_DB_PATH=./data.db sam help\n```\n\nor provide them without the 'SAM\\_' prefix in a [.samrc configuration file](test/.samrc):\n\n```json\n{\n    \"SCHEMA_PATH\": \"./schema.sql\",\n    \"DB_PATH\": \"./data.db\"\n}\n```\n\nsqlite-auto-migrator will keep track of the operations needed to change the database state to your various schema states through time. These are stored in the `migrations` table and `migrations` folder. You can specify these as `SAM_MIGRATION_TABLE` and `SAM_MIGRATION_PATH` environment variables respectively. You can also provide the config via a JavaScript object as seen in the [JavaScript Migration Management](#javascript-migration-management) section.\n\n### Automatically Make the Database Schema Match the Schema File\n\nThe following code will automatically create a migration file if needed (a record of operations to apply to your database to make it match the schema file) and apply it to your database:\n\n```js\nimport { Migrator } from 'sqlite-auto-migrator';\nconst migrator = new Migrator();\n\nawait migrator.make();\nawait migrator.migrate();\n```\n\nYou can add this to your CI/CD pipeline or on application startup to ensure that your database schema is always up to date with your schema file.\n\nYou can leave out the `await migrator.make();` line if you only want to apply the migrations and not create new ones. This plays well with a workflow where you create migration files by running `sam make` from the commandline when you are ready to save your schema file changes to the database and then your code auto applies the changes.\n\nsqlite-auto-migrator will automatically figure out if the content of the migration folder has changed and unapply any removed migration files and unapply+reapply modified migration files. By keeping the migration files in version control, you can easily roll back to a previous database state by checking out an older commit.\n\n## Documentation\n\n### JavaScript Migration Management\n\nStart by importing the `Migrator` class and creating a new instance:\n\n```js\nimport { Migrator } from 'sqlite-auto-migrator';\n\nconst migrator = new Migrator(\n  {\n    /** Path to the SQLite database file. Default is `process.env.SAM_DB_PATH` if provided, otherwise `path.join(process.cwd(), 'data.db')` */\n    dbPath?: string;\n    /** Path to the migrations folder. Default is `process.env.SAM_MIGRATION_PATH` if provided, otherwise `path.join(process.cwd(), 'migrations')` */\n    migrationsPath?: string;\n    /** Name of the table to store migration information in. Default is `process.env.SAM_MIGRATIONS_TABLE` if provided, otherwise `migrations` */\n    migrationsTable?: string;\n    /** Path to the schema file. Default is `process.env.SAM_SCHEMA_PATH` if provided, otherwise `path.join(process.cwd(), 'schema.sql')` */\n    schemaPath?: string;\n    /** Whether to create a new database file instead of throwing an error if it is missing. Default is true if `process.env.SAM_CREATE_DB_IF_MISSING === 'true'` and false otherwise */\n    createDBIfMissing?: boolean;\n    /** True if only renames (not creates+deletes) should be tracked in migration files, false otherwise. Default is true if `process.env.SAM_ONLY_TRACK_AMBIGUOUS_STATE === 'true'` and false otherwise */\n    onlyTrackAmbiguousState?: boolean;\n    /** True if table, column, index, virtual table, trigger, and view names should be case insensitive, false otherwise. Default is true if `process.env.SAM_IGNORE_NAME_CASE === 'true'` and false otherwise */\n    ignoreNameCase?: boolean;\n    /** True if warnings should be hidden, false otherwise. Default is true if `process.env.SAM_HIDE_WARNINGS === 'true'` and false otherwise */\n    hideWarnings?: boolean;\n    /** Path to the configuration file. Default is `process.env.SAM_CONFIG_PATH` if provided, otherwise `path.join(process.cwd(), '.samrc')`. The config file is a json file where the object keys are the same as the environment variables minus the SAM_ prefix. The provided keys act as defaults and are overridden by the environment variables if they exist */\n    configPath?: string;\n  }\n);\n```\n\n\u003e Commonjs syntax is not supported. Use `import` instead of `require`.\n\nThen make new migration files (by default, you'll be prompted via the console to confirm renames and destructive changes):\n\n```js\nawait migrator.make(\n  {\n    /** How to handle autodetected column/table renames.  Default is `process.env.SAM_ON_RENAME` if provided, otherwise `Migrator.PROMPT` */\n    onRename?: Migrator.PROMPT | Migrator.PROCEED | Migrator.SKIP | Migrator.REQUIRE_MANUAL_MIGRATION;\n    /** How to handle irreversible changes like dropping tables/columns. Default is `process.env.SAM_ON_DESTRUCTIVE_CHANGE` if provided, otherwise `Migrator.PROMPT` */\n    onDestructiveChange?: Migrator.PROMPT | Migrator.PROCEED | Migrator.SKIP | Migrator.REQUIRE_MANUAL_MIGRATION;\n    /** How to handle dropped/changed views. Default is `process.env.SAM_ON_CHANGED_VIEW` if provided, otherwise `Migrator.PROCEED` */\n    onChangedView?: Migrator.PROMPT | Migrator.PROCEED | Migrator.SKIP | Migrator.REQUIRE_MANUAL_MIGRATION;\n    /** How to handle dropped/changed indices. Default is `process.env.SAM_ON_CHANGED_INDEX` if provided, otherwise `Migrator.PROCEED` */\n    onChangedIndex?: Migrator.PROMPT | Migrator.PROCEED | Migrator.SKIP | Migrator.REQUIRE_MANUAL_MIGRATION;\n    /** How to handle dropped/changed triggers. Default is `process.env.SAM_ON_CHANGED_TRIGGER` if provided, otherwise `Migrator.PROCEED` */\n    onChangedTrigger?: Migrator.PROMPT | Migrator.PROCEED | Migrator.SKIP | Migrator.REQUIRE_MANUAL_MIGRATION;\n    /** Whether to create a new migration file even if no changes are needed. Default is true if `process.env.SAM_CREATE_IF_NO_CHANGES === 'true'` and false otherwise */\n    createIfNoChanges?: boolean;\n  },\n  /** a function to log progress messages through. Default is `process.stdout.write` */\n  log?: Function\n);\n```\n\n\u003e All table, index, view, trigger, and virtual table operations are supported, however custom extensions are not. If you need to use a custom extension, you'll have to manually edit the migration files.\n\nFinally, apply the migrations:\n\n```js\nawait migrator.migrate(\n  /** the migration to set the database state to, e.g. \"0001\", \"zero\" or \"latest\" (default) */\n  target?: string,\n  /** specifies how to handle renames/destructive changes and more if onlyTrackAmbiguousState is true */\n  diffargs?: MigrateUntrackedStateOptions\n  /** a function to log progress messages through. Default is `process.stdout.write` */\n  log?: Function\n);\n```\n\n\u003e Either all the migrations are applied or they are rolled back and a RolledBackTransaction error is thrown. This is to ensure that the database is always in a consistent state.\n\nCheck the status of the migrations and database:\n\n```js\nconst status = await migrator.status();\n```\n\n\u003e This returns a [`Status`](types/lib/migrator.d.mts) object. You can use the `status.pragmas` object to apply any non-persisted pragmas to your database connection.\n\n### Command Line Interface\n\n```console\n$ sam help\n```\n\nTo see a list of available commands and options including all the 'SAM\\_' environment variables you can set.\n\n```console\n$ sam status [--no-output]\n```\n\nPrints a message to the console showing the current migration, the migrations that have yet to be applied, and whether there have been changes made between the schema file and migration files.\n\n```console\n$ sam make [--no-output]\n```\n\nCreates a new migration file in the migrations folder that when applied with `sam migrate` will bring the database state to match the schema file.\n\n```console\n$ sam migrate [--no-output] [\u003ctarget migration\u003e]\n```\n\nApplies the unapplied migrations in the migrations folder up to the target migration. If no target migration is provided, all unapplied migrations are applied. Also unapplies any migrations that have been removed from the migrations folder. The target migration can be the migration id or one of the following special values: `zero`, `latest`. If no target migration is provided, the default is `latest`. If the target migration is `zero`, all migrations are unapplied.\n\n\u003e Note: The target migration must be the last argument if provided.\n\n### Understanding Migration Files\n\nEach migration file represents a database state. In most cases, you will automatically create the migration files using the `make` function. However, you can also create/tweak them manually. They are written in JavaScript to allow flexibility in the sort of operations they perform. Checkout this [sample migration](test/valid_migrations/0000_sample_migration.mjs). All a migration file is, is a script that exports an `up` and `down` function and a `PRAGMAS` object. The `up` function is run in a transaction with deferred foreign key constraints and takes care of bringing the database from the state of the previous migration file to that of this migration file. The `down` function undoes the changes made by the `up` function. The `PRAGMAS` object is used to specify the pragmas associated with this database state. The `PRAGMAS` object is optional and can be empty if no pragmas need to be set. The naming convention for migration files is `id_name.mjs` where `id` is a zero-padded number and `name` can be any descriptive name. The `id` is used to order the migrations and the `name` is largely ignored and only used for display purposes so you are free to change it.\n\n### Declarative Migrations without Migration Files\n\nMigration files are [necessary to clarify ambiguities](https://github.com/SanderGi/sqlite-auto-migrator/issues/3) and allow fine-grained control over the database schema state (revert to past versions, checkout different versions via VCS, and more). However, if you only need creation/deletion operations (no renames), the library supports declarative migrations without the migration folder/table. Enable these with the `SAM_ONLY_TRACK_AMBIGUOUS_STATE=true` environment variable or the `onlyTrackAmbiguousState` option:\n\n```js\nconst migrator = new Migrator({\n    onlyTrackAmbiguousState: true,\n});\nawait migrator.migrate();\n```\n\nWith declarative migrations, the library will apply create statements to make the database schema match the schema file and throw `ManualMigrationRequired` errors for any required deletes. You can allow deletes with the `onDestructiveChange` option:\n\n```js\nconst migrator = new Migrator({\n    onlyTrackAmbiguousState: true,\n});\nawait migrator.migrate('latest', {\n    onDestructiveChange: Migrator.PROCEED,\n});\n```\n\n\u003e You have access to the same options as `Migrator.make` here, however `Migrator.PROMPT` will act like `Migrator.REQUIRE_MANUAL_MIGRATION` to avoid databases from diverging due to differing user inputs.\n\nIt is not recommended to use `onRename=Migrator.PROCEED` with declarative migrations as it can cause databases to diverge. To handle renames, you should instead add a `migrator.make()` call to track the rename with a migration file. In this mode, the make call will only create migration folder/table/files if a rename is made, otherwise it will do nothing.\n\n```js\nconst migrator = new Migrator({\n    onlyTrackAmbiguousState: true,\n});\nawait migrator.make();\nawait migrator.migrate();\n```\n\n### Asynchronous Database Wrapper\n\nThe migration functions `up` and `down` get access to a `Database` instance which is a promise based wrapper around the callback based [sqlite3](https://www.npmjs.com/package/sqlite3) library (or the synchronous `bun:sqlite` when run via bun). You can also import the `Database` class and instantiate it in your own scripts:\n\n```js\nimport { Database } from 'sqlite-auto-migrator';\n\nconst db = await Database.connect('path/to/database.db');\n```\n\nYou can use it to run queries:\n\n```js\nconst rows = await db.all('SELECT * FROM table');\n```\n\nInsert rows (and get the last inserted row id):\n\n```js\nconst { lastID } = await db.run('INSERT INTO table (column) VALUES (?)', 'value', 'value');\n```\n\nUpdate rows (and get the number of changed rows):\n\n```js\nconst { changes } = await db.run('UPDATE table SET column = ? WHERE id = ?', 'value', 1);\n```\n\nIterate through rows:\n\n```js\nfor await (const row of db.each('SELECT * FROM table')) {\n    console.log(row);\n}\n```\n\nCreate prepared statements:\n\n```js\nconst stmt = await db.prepare('SELECT * FROM table WHERE column = ?');\nconst rows = await stmt.all('value');\n```\n\nClose the database connection:\n\n```js\nawait db.close();\n```\n\nAnd more. Checkout the [documentation](types/lib/database.d.mts) for the `Database` class for more information.\n\n### TypeScript and JSDoc Support\n\nYou can import the types using `import type` in TypeScript to avoid including them in the compiled output while still getting static analysis and autocomplete:\n\n```ts\nimport type { MigrationOptions, MakeOptions, Action, Status } from 'sqlite-auto-migrator';\n\nconst options: MigrationOptions = {\n    dbPath: './data.db',\n};\nconst migrator = new Migrator(options);\n\nconst action: Action = Migrator.PROCEED;\nconst makeOptions: MakeOptions = {\n    onRename: action,\n};\nmigrator.make(makeOptions);\n\nconst status: Status = await migrator.status();\n```\n\nAnd equivalently in JavaScript with JSDoc:\n\n```js\n/** @typedef {import('sqlite-auto-migrator').MigrationOptions} MigrationOptions */\n/** @typedef {import('sqlite-auto-migrator').MakeOptions} MakeOptions */\n/** @typedef {import('sqlite-auto-migrator').Action} Action */\n/** @typedef {import('sqlite-auto-migrator').Status} Status */\n\n/** @type {MigrationOptions} */\nconst options = {\n    dbPath: './data.db',\n};\nconst migrator = new Migrator(options);\n\n/** @type {Action} */\nconst action = Migrator.PROCEED;\n/** @type {MakeOptions} */\nconst makeOptions = {\n    onRename: action,\n};\nmigrator.make(makeOptions);\n/** @type {Status} */\nconst status = await migrator.status();\n```\n\nYou can also import the error classes to catch specific errors:\n\n```ts\nimport { Errors } from 'sqlite-auto-migrator';\nconst { RolledBackTransaction, ValidationError, IntegrityError, ManualMigrationRequired } = Errors;\n\ntry {\n    await migrator.migrate();\n} catch (error) {\n    if (error instanceof RolledBackTransaction) {\n        console.error('The transaction was rolled back');\n    } else if (error instanceof ValidationError) {\n        console.error('The input was invalid');\n    } else if (error instanceof IntegrityError) {\n        console.error('The final database state was corrupted');\n    } else if (error instanceof ManualMigrationRequired) {\n        console.error('A manual migration is required');\n    } else {\n        throw error;\n    }\n}\n```\n\nThe `Database` types are a bit more interesting. You can declare a type for the rows returned by a query and pass as a generic to the `Database` methods:\n\n```ts\ntype Row = {\n    id: number;\n    name: string;\n};\n\nconst db = await Database.connect(':memory:');\nconst row = await db.get\u003cRow\u003e('SELECT * FROM users WHERE id = ?', 1);\n```\n\nThis can be baked into a prepared statement and even include a type for its params:\n\n```ts\ntype Params = {\n    $id: number;\n    $name: string;\n};\nconst stmt = await db.prepare\u003cRow, Params\u003e('SELECT * FROM users WHERE id = $id AND name = $name');\nconst rows = await stmt.all({ $id: 1, $name: 'Alice' }); // type checks\nconst row = await stmt.get({ $id: 1 }); // type errors because $name is missing\n```\n\nJSDoc generics look less clean but work the same way:\n\n```js\n/**\n * @typedef {Object} Row\n * @property {string} id\n * @property {string} name\n */\n\n/** @type {ReturnType\u003ctypeof db.get\u003cRow\u003e\u003e} */\nconst row = db.get('SELECT * FROM users WHERE id = ? AND name = ?', 1, 'Bob');\n```\n\n## Examples\n\nThe following application uses the sqlite-auto-migrator: [Attendance Scanner](https://github.com/clr-li/AttendanceScanner).\nYou can also take a look at the [test suite](test) and [cli](lib/cli.js) for more examples.\n\n## Alternatives\n\n-   [node-sqlite](https://github.com/kriasoft/node-sqlite#migrations) is an asynchronous SQLite client for Node.js which can run SQL based migration scripts. Not as flexible as JavaScript based migrations and also does not automatically generate migration files like sqlite-auto-migrator.\n-   [django](https://docs.djangoproject.com/en/5.0/topics/migrations/) has pretty awesome automatic migrations. The caveat is they are not focused on SQLite (they do not recommend using their SQLite migrations for critical data), use Python for the migration files and the schema, and are part of a larger server framework.\n-   [declarative migrations](https://david.rothlis.net/declarative-schema-migration-for-sqlite/) is a [simple Python script](https://david.rothlis.net/declarative-schema-migration-for-sqlite/migrator.py) for migrating the database state to match a schema file without keeping track of migration files. Does not support renaming columns/tables. Also does not include triggers, virtual tables, views, etc.\n-   [sqldef](https://github.com/sqldef/sqldef) allows comparing schema files and database schemas. Does not support renaming columns/tables.\n\n## Related Tools\n\n-   SQL string syntax highlighting: VS Code: [ES6 String HTML](https://marketplace.visualstudio.com/items?itemName=Tobermory.es6-string-html). Sublime Text: [javascript-sql-sublime-syntax](https://github.com/AsterisqueDigital/javascript-sql-sublime-syntax). Vim: [vim-javascript-sql](https://github.com/statico/vim-javascript-sql).\n-   [sql-strings](https://www.npmjs.com/package/sql-strings) creates prepared statements and bind parameters with a nice syntax using es6 template strings.\n\n## Contributing\n\nAll constructive contributions are welcome including anything from bug fixes and new features to improved documentation, tests and more! Feel free to open an issue to discuss the proposed change and then submit a pull request :)\n\n### Security Issues\n\nIf you discover a security vulnerability in sqlite-auto-migrator, please contact the [current main maintainer](#contributors).\n\n### Running Tests\n\nTests run automatically pre-commit using [Husky](https://typicode.github.io/husky/). To run the test suite manually, first install the dependencies, then run `npm test`:\n\n```console\n$ npm install\n$ npm test\n```\n\n### Linting and Formatting\n\n[Eslint](https://eslint.org/) is used for static analysis, [fixpack](https://www.npmjs.com/package/fixpack) is used to standardize package.json and [Prettier](https://prettier.io/) is used for automatic formatting. Linting will automatically run pre-commit using [Husky](https://typicode.github.io/husky/) and [Lint-Staged](https://www.npmjs.com/package/lint-staged). Formatting can be set up to happen [automatically in your editor](https://prettier.io/docs/en/editors.html) (e.g. on save). Formatting and linting can also be run manually:\n\n```console\n$ npm install\n$ npm run format\n$ npm run lint\n```\n\n### Generating TypeScript Types\n\nTypescript types are automatically generated from the JSDoc in the `/types` folder when the npm package is packaged/published. To update the TypeScript types manually, run the following command\n\n```console\n$ npm run types\n```\n\nThis will allow TypeScript users to benefit from the type information provided in the JSDoc.\n\nIf you also want to generate the readme badges, run the following command:\n\n```console\n$ npm run build\n```\n\n## Contributors\n\nAll contributions will be listed here:\n\n1. [@SanderGi](https://sandergi.github.io) - Main maintainer and author\n2. [@buzzy](https://github.com/buzzy) - Bun compatibility and other bug reports, testing and feedback\n\nFunctionality is inspired by [David Rothlis's migration script](https://david.rothlis.net/declarative-schema-migration-for-sqlite/) and made in consultance with the SQLite documentation, particularly the [alter table instructions](https://www.sqlite.org/lang_altertable.html), [schema table](https://www.sqlite.org/schematab.html), [quirks list](https://www.sqlite.org/quirks.html) and [language documentation](https://www.sqlite.org/lang.html).\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsandergi%2Fsqlite-auto-migrator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsandergi%2Fsqlite-auto-migrator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsandergi%2Fsqlite-auto-migrator/lists"}