{"id":13485136,"url":"https://github.com/halvardssm/deno-nessie","last_synced_at":"2025-04-04T13:13:25.693Z","repository":{"id":41846806,"uuid":"255932763","full_name":"halvardssm/deno-nessie","owner":"halvardssm","description":"A modular Deno library for PostgreSQL, MySQL, MariaDB and SQLite migrations","archived":false,"fork":false,"pushed_at":"2024-04-10T07:30:49.000Z","size":805,"stargazers_count":529,"open_issues_count":8,"forks_count":31,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-03-28T12:08:57.674Z","etag":null,"topics":["deno","deno-mysql","deno-postgres","deno-sqlite","denoland","hacktoberfest","mysql","postgres","postgresql","sqlite3","typescript"],"latest_commit_sha":null,"homepage":"","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/halvardssm.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"halvardssm","ko_fi":"halvardm"}},"created_at":"2020-04-15T13:55:54.000Z","updated_at":"2024-11-18T03:14:25.000Z","dependencies_parsed_at":"2022-08-25T18:21:33.070Z","dependency_job_id":"fdb0e2fb-5938-4c8f-9164-2fbca8bdb6c7","html_url":"https://github.com/halvardssm/deno-nessie","commit_stats":{"total_commits":351,"total_committers":23,"mean_commits":15.26086956521739,"dds":0.3105413105413105,"last_synced_commit":"3f78365a3115c32ccef782f93c9d333a15fef8e4"},"previous_names":[],"tags_count":58,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halvardssm%2Fdeno-nessie","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halvardssm%2Fdeno-nessie/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halvardssm%2Fdeno-nessie/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halvardssm%2Fdeno-nessie/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/halvardssm","download_url":"https://codeload.github.com/halvardssm/deno-nessie/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247182401,"owners_count":20897381,"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","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":["deno","deno-mysql","deno-postgres","deno-sqlite","denoland","hacktoberfest","mysql","postgres","postgresql","sqlite3","typescript"],"created_at":"2024-07-31T17:01:47.258Z","updated_at":"2025-04-04T13:13:25.671Z","avatar_url":"https://github.com/halvardssm.png","language":"TypeScript","funding_links":["https://github.com/sponsors/halvardssm","https://ko-fi.com/halvardm"],"categories":["TypeScript","Uncategorized","基础设施","Tools","Modules"],"sub_categories":["Uncategorized","Deno 源","Online Playgrounds","Assistants","Database"],"readme":"\u003ch1 align=\"center\"\u003eNessie\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://deno.land/x/nessie\"\u003e\n    \u003cimg alt=\"GitHub release (latest SemVer)\" src=\"https://img.shields.io/github/v/release/halvardssm/deno-nessie?label=Nessie%20stable\u0026style=for-the-badge\u0026logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEUAAABLCAYAAAAmh0pZAAAACXBIWXMAAAEjAAABIwFyQXfeAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2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EltrPAeI76hrLqrBz1qEScl4xfqEZuSP4/aLLwWOQC9ScAAAAASUVORK5CYII=\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://deno.land/x/nessie\"\u003e\n    \u003cimg alt=\"GitHub release (latest by date including pre-releases)\" src=\"https://img.shields.io/github/v/release/halvardssm/deno-nessie?include_prereleases\u0026label=Nessie%20Next\u0026style=for-the-badge\u0026logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEUAAABLCAYAAAAmh0pZAAAACXBIWXMAAAEjAAABIwFyQXfeAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAABltJREFUeJztnF2MHlUZx3+nXWlBWsJXaAWElI+iIBIhaAPcaDUEUrghApEQEhIMmKA1jTcmGkOUQPhKFC4gEFNpUuQC0l4YlK8CsUBLjBI+2m4pRdsldWuLLN3WbvfnxZk3u7zMO+/M+87szG75Jc3unnPmnOf5z5mZc55zTqFH1MvUP6ib1VF1p/qceot6VK/1TkvUE9WnzGZQvaxuW6cE9cvq1i6CtNivXl23zZWiHq1uyilIi1H1wrptrwz1kYKCtNikHlG3/aWjfkU91KMoqj+u24fSUR/qQxDVYfWLdfuRl1k5yy3rs53jgWv6rGPK6CqKuhA4pYS2Zo4owBkltbVUnVdSXZWSR5Sy3gVzgW+UVFel5BFloMT2Ti6xrsrI+6Iti7lT3F5P5BHl4xLb21RiXZXRjyjrC7a1A9hY8JpayCPKnJS0YeB7wLMF2vp5COFAgfLNRV2aMkJ9Pck7Qn3A7CnAfvX2uv0oFfWGFEdXt5X5mvqoOpTkHzQGn+5Xz6rL9l7J87lNG7xtm/xHCOFN4GYA9QtJ2sG+rauJXkV5r1Ph6SxGi16H+R1FmQnkEWVRStq2lLTDA3WeOt72kh1X0z7TM4ZuPeXrQGhL2z1jxhsd6CbKBSlpQ1UY0iTy9JR2dlZhSJP4vKek0FEUdTbw1ZSsw7qnLAbS1oR3VWRLY8gSJe3RAfhvFYY0iSxR0l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M34IAoP7M3qb6Q8bj/v/qc6JXJuvU88sS5hL1SfXjHA1vNy6QzU+unaPeZFwibQKjaqdViFx86uujDhD3ui0GzmRi+XQfMZS4IYTwdoa45xD3sJzaj1Ft/IeJBbq8jAIXhBA2l2hH7xhjLHl6nMZe96DpYc8x9TtJnat66DGr6tbiU6hXJE51YzgpP0f9ICX/riR/vsUfz+F6VUhB/YH6vxzGn5KUP9sY3x2elPf7SfUdp75SQJQPa3M+C2OP2dPF+LParhlQv238747uaMubbQyPDuYQpbkLcOoi9dUM49P217WuzTpQsUi9MhHpcXXLpDr/bVNWATphjPjfZtzbMplD6jEltrPAeI76hrLqrBz1qEScl4xfqEZuSP4/aLLwWOQC9ScAAAAASUVORK5CYII=\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://doc.deno.land/https/deno.land/x/nessie/mod.ts\"\u003e\n    \u003cimg alt=\"Docs\" src=\"https://img.shields.io/badge/Nessie-doc-informational.svg?style=for-the-badge\u0026logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEUAAABLCAYAAAAmh0pZAAAACXBIWXMAAAEjAAABIwFyQXfeAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAABltJREFUeJztnF2MHlUZx3+nXWlBWsJXaAWElI+iIBIhaAPcaDUEUrghApEQEhIMmKA1jTcmGkOUQPhKFC4gEFNpUuQC0l4YlK8CsUBLjBI+2m4pRdsldWuLLN3WbvfnxZk3u7zMO+/M+87szG75Jc3unnPmnOf5z5mZc55zTqFH1MvUP6ib1VF1p/qceot6VK/1TkvUE9WnzGZQvaxuW6cE9cvq1i6CtNivXl23zZWiHq1uyilIi1H1wrptrwz1kYKCtNikHlG3/aWjfkU91KMoqj+u24fSUR/qQxDVYfWLdfuRl1k5yy3rs53jgWv6rGPK6CqKuhA4pYS2Zo4owBkltbVUnVdSXZWSR5Sy3gVzgW+UVFel5BFloMT2Ti6xrsrI+6Iti7lT3F5P5BHl4xLb21RiX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XEz/ZUsxNYHkL4Y1UNdBJlIfBPis2Ip5r1wJ0hhLVlV5wajgwhDAF/KbuxklkCrFFfNM7XSjtkldpTANRLgZeyyjSMA8AG4q7u94g9fQTYT775WYvtmQ6rTwDf79HI6cpQN1FOBf5GPO52uPBot007u4F/ECd1M5lPgHXEYNgtWe+UZcD9lHdcrimMA+8QJ62vEocab4UQxloFPiOKuhT4NXDxFBlZNbuIzrdE2BBCyNxjEyCexiCu/q1geotxCHgL+CtxHLM+hLClaCVBvRG4k4kljOnGGLAaeAp4IYSwp98KB4hR++m8KL6NibhM34IAoP7M3qb6Q8bj/v/qc6JXJuvU88sS5hL1SfXjHA1vNy6QzU+unaPeZFwibQKjaqdViFx86uujDhD3ui0GzmRi+XQfMZS4IYTwdoa45xD3sJzaj1Ft/IeJBbq8jAIXhBA2l2hH7xhjLHl6nMZe96DpYc8x9TtJnat66DGr6tbiU6hXJE51YzgpP0f9ICX/riR/vsUfz+F6VUhB/YH6vxzGn5KUP9sY3x2elPf7SfUdp75SQJQPa3M+C2OP2dPF+LParhlQv238747uaMubbQyPDuYQpbkLcOoi9dUM49P217WuzTpQsUi9MhHpcXXLpDr/bVNWATphjPjfZtzbMplD6jEltrPAeI76hrLqrBz1qEScl4xfqEZuSP4/aLLwWOQC9ScAAAAASUVORK5CYII=\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://deno.land\"\u003e\n    \u003cimg alt=\"Deno Version\" src=\"https://img.shields.io/badge/deno-v1.37.0-green.svg?style=for-the-badge\u0026logo=deno\"/\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/halvardssm/deno-nessie/actions?query=branch%3Amain+workflow%3ACI\"\u003e\n    \u003cimg alt=\"GitHub Workflow Status (branch)\" src=\"https://img.shields.io/github/workflow/status/halvardssm/deno-nessie/CI/main?style=for-the-badge\u0026logo=github\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://app.codecov.io/gh/halvardssm/deno-nessie\"\u003e\n    \u003cimg alt=\"Codecov\" src=\"https://img.shields.io/codecov/c/gh/halvardssm/deno-nessie?logo=codecov\u0026style=for-the-badge\u0026token=O59WOJ5W00\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"./LICENSE\"\u003e\n    \u003cimg alt=\"License\" src=\"https://img.shields.io/github/license/c4spar/deno-cliffy?logo=github\u0026style=for-the-badge\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://discord.gg/8WXfG2tvfr\"\u003e\n    \u003cimg alt=\"Discord\" src=\"https://img.shields.io/badge/chat-on%20discord-green.svg?style=for-the-badge\u0026logo=discord\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://hub.docker.com/repository/docker/halvardm/nessie\"\u003e\n    \u003cimg alt=\"Docker Image Size (tag)\" src=\"https://img.shields.io/docker/image-size/halvardm/nessie/latest?logo=docker\u0026style=for-the-badge\" /\u003e\n  \u003c/a\u003e\n  \u003cbr\u003e\n  \u003ca href=\"https://deno.land/x/nessie\"\u003e\n    \u003cimg alt=\"deno.land\" src=\"https://img.shields.io/badge/Published%20on-deno.land-blue?logo=deno\u0026labelColor=272727\u0026color=272727\u0026style=for-the-badge\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://nest.land/package/Nessie\"\u003e\n    \u003cimg alt=\"nest.land\" src=\"https://nest.land/badge-large.svg\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cb\u003eA modular database migration tool for \u003ca href=\"https://deno.land\"\u003eDeno\u003c/a\u003e inspired by \u003ca href=\"https://github.com/laravel/laravel\"\u003eLaravel\u003c/a\u003e and \u003ca href=\"https://github.com/cakephp/phinx\"\u003ePhinx\u003c/a\u003e.\u003c/b\u003e\u003c/br\u003e\n  \u003csub\u003eSupports PostgreSQL, MySQL, MariaDB and SQLite.\u003c/sub\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"./.github/logo.png\" alt=\"Nessie logo\" width=\"200\" height=\"200\"\u003e\u003c/p\u003e\n\n**Call for donations**: If you are using Nessie commercially, please consider\nsupporting the future development. See\n[this issue](https://github.com/halvardssm/deno-nessie/issues/130) for more\ninformation.\n\n\u003e ⚠️ With the native Prisma support for Deno, I no longer use Nessie for my\n\u003e projects. This means that Nessie will be unmaintained in the near future. See\n\u003e the related [issue](https://github.com/halvardssm/deno-nessie/issues/165) for\n\u003e more information.\n\n🎉 **Version 2 is released**: To migrate from version 1 follow the steps in the\n[migration section](#migrate-from-version-1) bellow.\n\n\u003e See documentation for the\n\u003e [clients](https://doc.deno.land/https/deno.land/x/nessie/mod.ts).\n\n\u003e Even though all examples in this readme applies unversioned usage, you should\n\u003e always use a version when using Nessie.\n\n---\n\n## Contents\n\n- [Contents](#contents)\n- [Available Via](#available-via)\n- [CLI Usage](#cli-usage)\n  - [Flags](#flags)\n  - [Deno flags and Permissions](#deno-flags-and-permissions)\n  - [Config file](#config-file)\n  - [Remote Migration or Seed files](#remote-migration-or-seed-files)\n  - [Custom Migration or Seed templates](#custom-migration-or-seed-templates)\n- [Docker usage](#docker-usage)\n- [Uses](#uses)\n- [Examples](#examples)\n- [Clients](#clients)\n  - [How to make a client](#how-to-make-a-client)\n- [Migrate from version 1](#migrate-from-version-1)\n- [Contributing](#contributing)\n\n## Available Via\n\n- https://deno.land/x/nessie\n- https://raw.githubusercontent.com/halvardssm/deno-nessie\n- https://nest.land/package/Nessie\n- https://hub.docker.com/repository/docker/halvardm/nessie\n\n## CLI Usage\n\n\u003e It is suggested you restrict the permissions Nessie has as much as possible,\n\u003e to only the permissions its needs. An example of this is:\n\u003e\n\u003e ```shell\n\u003e deno install --unstable --allow-net=\u003cdb hostname/ip\u003e:\u003cdb port\u003e --allow-read=. --allow-write=nessie.config.ts,db -f  https://deno.land/x/nessie/cli.ts\n\u003e ```\n\n- `init`: Generates a `nessie.config.ts` file and also the `db` folder where\n  migration and seed files will be placed. Two options are available: `--mode`\n  and `--dialect`.\n\n  - `--mode` can be one of `config` or `folders`. If mode is not set, it will\n    create a `nessie.config.ts` file and the `db` folder structure, otherwise it\n    will create the selected one.\n\n  - `--dialect` is used for the config file and can be one of `pg`, `mysql` or\n    `sqlite`. If not set, it will create a general config file including all\n    three dialects, otherwise it will include only the selected one.\n\n  ```shell\n  deno run -A --unstable https://deno.land/x/nessie/cli.ts init\n\n  deno run -A --unstable https://deno.land/x/nessie/cli.ts init --mode folders\n\n  deno run -A --unstable https://deno.land/x/nessie/cli.ts init --mode config --dialect pg\n\n  deno run -A --unstable https://deno.land/x/nessie/cli.ts init --mode config --dialect sqlite\n\n  deno run -A --unstable https://deno.land/x/nessie/cli.ts init --mode config --dialect mysql\n  ```\n\n- `make:migration [name]` \u0026 `make [name]`: Create migration, `name` has to be\n  snake- and lowercase, it can also include numbers. You can also provide the\n  flag `--migrationTemplate \u003ctemplate path or url\u003e` or use the\n  `migrationTemplate` property in the config file to tell Nessie which template\n  to use when generating a new migration.\n\n  ```shell\n  deno run -A --unstable https://deno.land/x/nessie/cli.ts make:migration create_users\n\n  deno run -A --unstable https://deno.land/x/nessie/cli.ts make create_users\n\n  deno run -A --unstable https://deno.land/x/nessie/cli.ts make --migrationTemplate some_custom_template create_users\n  ```\n\n- `make:seed [name]`: Create seed, `name` has to be snake- and lowercase, it can\n  also include numbers. You can also provide the flag\n  `--seedTemplate \u003ctemplate path or url\u003e` or use the `seedTemplate` property in\n  the config file to tell Nessie which template to use when generating a new\n  migration.\n\n  ```shell\n  deno run -A --unstable https://deno.land/x/nessie/cli.ts make:seed add_users\n\n  deno run -A --unstable https://deno.land/x/nessie/cli.ts make:seed --seedTemplate some_custom_template add_users\n  ```\n\n- `migrate [amount?]`: Run migration - will migrate your migrations in your\n  migration folder (sorted by timestamp) newer than the latest migration in your\n  db. Amount defines how many migrations, defaults to all available if not set.\n\n  ```shell\n  deno run -A --unstable https://deno.land/x/nessie/cli.ts migrate\n\n  deno run -A --unstable https://deno.land/x/nessie/cli.ts migrate 1\n\n  deno run -A --unstable https://deno.land/x/nessie/cli.ts migrate -c ./nessie.config.ts\n  ```\n\n- `rollback [amount?]`: Rollback - will rollback your migrations. Amount defines\n  how many migrations, defaults to 1 if not set.\n\n  ```shell\n  deno run -A --unstable https://deno.land/x/nessie/cli.ts rollback\n\n  deno run -A --unstable https://deno.land/x/nessie/cli.ts rollback 2\n\n  deno run -A --unstable https://deno.land/x/nessie/cli.ts rollback all\n  ```\n\n- `seed [matcher?]`: Seed - will seed your database. Optional matcher will match\n  all files in your seed folder by string literal or RegExp.\n\n  ```shell\n  deno run -A --unstable https://deno.land/x/nessie/cli.ts seed\n\n  deno run -A --unstable https://deno.land/x/nessie/cli.ts seed seed_file.js\n\n  deno run -A --unstable https://deno.land/x/nessie/cli.ts seed \".+.ts\"\n  ```\n\n- `status`: Outputs the status of Nessie. Will output detailed information about\n  current state of the migrations. Includes two flags: `--output` and\n  `--file-names`.\n\n  `--output` sets the output format and can be one of `log` or `json`. If not\n  set, `log` is chosen by default. If result is used programatically, chose\n  `json` as the format of `log` can change with every patch version, while the\n  format of `json` will be considered more stable.\n\n  `--file-names` adds the file names to each of the outputs.\n\n  ```shell\n  deno run -A --unstable https://deno.land/x/nessie/cli.ts status\n  totalAvailableMigrationFiles: 1\n  completedMigrations: 0\n  newAvailableMigrations: 1\n\n  deno run -A --unstable https://deno.land/x/nessie/cli.ts status --output json\n  {\"totalAvailableMigrationFiles\":1,\"completedMigrations\":0,\"newAvailableMigrations\":1}\n\n  deno run -A --unstable https://deno.land/x/nessie/cli.ts status --file-names\n  totalAvailableMigrationFiles: 1\n    20210508115213_test1.ts\n  completedMigrations: 0\n  newAvailableMigrations: 1\n    20210508115213_test1.ts\n\n  deno run -A --unstable https://deno.land/x/nessie/cli.ts status --file-names --output json\n  {\"totalAvailableMigrationFiles\":1,\"completedMigrations\":0,\"newAvailableMigrations\":1,\"totalAvailableMigrationFileNames\":[\"20210508115213_test1.ts\"],\"completedMigrationNames\":[],\"newAvailableMigrationNames\":[\"20210508115213_test1.ts\"]}\n  ```\n\n- `update_timestamps`: Update timestamps - will update timestamps to the new\n  format. Will only update timestamps where the value is less than 1672531200000\n  (2023-01-01) so that the timestamps won't be updated multiple times.\n\n  ```shell\n  deno run -A --unstable https://deno.land/x/nessie/cli.ts update_timestamps\n  ```\n\n### Flags\n\n- `-c, --config`: Path to config file, will default to `./nessie.config.ts`\n- `-d, --debug`: Enables verbose output.\n- `--migrationTemplate`: Path or URL to a custom migration template. Only used\n  together with the `make` commands.\n- `--seedTemplate`: Path or URL to a custom seed template. Only used together\n  with the `make` commands.\n\n### Deno flags and Permissions\n\nWhile the examples simply show `-A` as the permission flag, you can also limit\nthe permissions according to your needs. Bellow you will see what Nessie\nactually needs.\n\n- `--unstable`: Needed by [std/fs/copy](https://deno.land/std@0.90.0/fs/copy.ts)\n  as it uses `Deno.utimeSync` and `Deno.utime` which are still unstable.\n- `--allow-read`: Nessie needs read access to be able to read the migration and\n  seed folders, it also checks for the presence of the config file.\n- `--allow-write`: When initiating Nessie or creating a new migration or seed\n  file, write access is required.\n- `--allow-net`: This is needed to import the nessie code in your config file.\n  It is also needed if you use a remote config or migration files, this flag is\n  needed to get access.\n\n### Config file\n\nThe config interface is exported from `mod.ts` as `NessieConfig`.\n\n```ts\nexport interface NessieConfig {\n  /** Can be any class which extends `AbstractClient`. */\n  client: AbstractClient\u003cany\u003e;\n  /**\n   * The folders where migration files are located.\n   * Can be a relative path or an absolute path.\n   * Defaults to ['./db/migrations/'] if additionalMigrationFiles is not populated\n   */\n  migrationFolders?: string[];\n  /**\n   * The folders where seed files are located.\n   * Can be a relative path or an absolute path.\n   * Defaults to ['./db/seeds/'] if additionalSeedFiles is not populated\n   */\n  seedFolders?: string[];\n  /**\n   * Additional migration files which will be added to the\n   * list to parse when running the migrate or rollback command.\n   * Can be any format supported by `import()` e.g. url or path\n   */\n  additionalMigrationFiles?: string[];\n  /**\n   * Additional seed files which will be added to the list to\n   * match against when running the seed command.\n   * Can be any format supported by `import()` e.g. remote url or path\n   */\n  additionalSeedFiles?: string[];\n  /** Custom migration template, can be path or url. When also using the CLI flag `--migrationTemplate`, it will have precidence. */\n  migrationTemplate?: string;\n  /** Custom seed template, can be path or url. When also using the CLI flag `--seedTemplate`, it will have precidence. */\n  seedTemplate?: string;\n  /** Enables verbose output for debugging */\n  debug?: boolean;\n}\n```\n\n### Remote Migration or Seed files\n\nWith the introduction of `additionalMigrationFiles` and `additionalSeedFiles`,\nyou can now include remote migration and seed files which you can fetch for\nexample via ftp or using api's like gihub or gitlab. Any input which can be\ngiven to the dynamic `import()` can be provided.\n\n```ts\n// nessie.config.ts\n...\nadditionalMigrationFiles: ['https://example.com/some_migration_file.ts'],\nadditionalSeedFiles: ['https://example.com/some_seed_file.ts'],\n...\n```\n\nSee the [example folder](./examples) for more examples.\n\n### Custom Migration or Seed templates\n\nAs your project grows, or you are starting to have multiple project but want the\nsame logic across the migrations, you might find it tedious to change the seed\nand migration files after creating them. To get around this, you can provide the\noptions `migrationTemplate` and `seedTemplate` in the config file, or use the\ncorresponding flags from the command line. There are no restrictions to what the\nfile has to contain, so you can even provide an empty file if that is your\npreferred starting point.\n\nA general usecase for providing custom templates is in the case that you use a\ncustom `AbstractMigration` or `AbstractSeed` class, and want to use this for all\nyour future migrations and seeds.\n\nSee the [example folder](./examples) for more examples.\n\n## Docker usage\n\nSee the specific [Nessie image docs](./image/README.md) for using Nessie with a\ndocker image.\n\n## Uses\n\n- [Cliffy](https://deno.land/x/cliffy/)\n- [Deno Postgres](https://deno.land/x/postgres/)\n- [Deno MySQL](https://deno.land/x/mysql/)\n- [Deno SQLite](https://deno.land/x/sqlite/)\n\n## Examples\n\nSee [example repo](https://github.com/halvardssm/deno-rest-api) for a REST API\nwhich uses Oak and Nessie.\n\nSee the [example folder](./examples) for more examples.\n\nNessie uses the `AbstractMigration` class which you can extend to access the\nclient and its properties. This enables better flexibility in migrations and\nseeds and allows a more complex workflow.\n\n`nessie.config.ts` with all default values\n\n```ts\nimport {\n  ClientPostgreSQL,\n  NessieConfig,\n} from \"https://deno.land/x/nessie/mod.ts\";\n\nconst clientPg = new ClientPostgreSQL({\n  database: \"nessie\",\n  hostname: \"localhost\",\n  port: 5432,\n  user: \"root\",\n  password: \"pwd\",\n});\n\nconst config: NessieConfig = {\n  client: clientPg,\n  migrationFolders: [\"./db/migrations\"],\n  seedFolders: [\"./db/seeds\"],\n  additionalMigrationFiles: [],\n  additionalSeedFiles: [],\n  migrationTemplate: undefined,\n  seedTemplate: undefined,\n  debug: false,\n};\n\nexport default config;\n```\n\nMinimal example of a migration file\n\n```ts\nimport {\n  AbstractMigration,\n  ClientPostgreSQL,\n  Info,\n} from \"https://deno.land/x/nessie/mod.ts\";\n\nexport default class extends AbstractMigration\u003cClientPostgreSQL\u003e {\n  async up({ dialect }: Info): Promise\u003cvoid\u003e {\n    await this.client.queryArray(\"CREATE TABLE table1 (id int)\");\n  }\n\n  async down({ dialect }: Info): Promise\u003cvoid\u003e {\n    await this.client.queryArray(\"DROP TABLE table1\");\n  }\n}\n```\n\nSeed file\n\n```ts\nimport {\n  AbstractSeed,\n  ClientPostgreSQL,\n  Info,\n} from \"https://deno.land/x/nessie/mod.ts\";\n\nexport default class extends AbstractSeed\u003cClientPostgreSQL\u003e {\n  async run({ dialect }: Info): Promise\u003cvoid\u003e {\n    await this.client.queryArray(\"INSERT INTO table1 VALUES (1234)\");\n  }\n}\n```\n\nSee the [example folder](./examples) for more\n\n## Clients\n\nProvided clients are\n\n- [PostgreSQL](./clients/ClientPostgreSQL.ts) (also works for CockroachDB)\n- [MySQL](./clients/ClientMySQL.ts) \u0026 [MySQL 5.5](./clients/ClientMySQL55.ts)\n  - Currently it works with password for 5.*, but for \u003e=8 you have to send a\n    blank password, see\n    [issue 37](https://github.com/manyuanrong/deno_mysql/issues/37)\n- [SQLite](./clients/ClientSQLite.ts)\n\n\u003e If you would like to see your DB flavor supported, take a look at how to make\n\u003e a client plugin with examples in the [clients folder](./clients) or in the\n\u003e next section .\n\n### How to make a client\n\nA client needs to extend [AbstractClient](./clients/AbstractClient.ts).\n\n`query`: Takes a query string or array of query strings and sends them of to the\ndatabase for execution. Should return whatever the database responds.\n\n`prepare`: Will be run when the migration or rollback commands are executed.\nThis should create the connection, set up the `nessie_migrations` table and\nprepare the database for incoming migrations.\n\n`migrate`: Takes a number as an optional input, will default to all files if not\nset. Will run `Math.min(amount, numberOfFiles)` migration files. Only handles\nthe `up` method.\n\n`rollback`: Takes a number as an optional input, will default to 1 if not set.\nWill run `Math.min(amount, numberOfFiles)` migration files. Only handles the\n`down` method.\n\n`seed`: Takes an optional matcher as input. Matcher can be regex or string. Will\nseed the database. Handles the `run` method in seed files.\n\n`close`: Will be the last method run before the program is finished. This should\nclose the database connection.\n\nSee the existing examples in the [clients](./clients) folder for reference.\n\n## Migrate from version 1\n\nIf you are migrating from version 1, and starting from scratch is not an option,\nthere are a couple of steps to perform. If you have any questions regarding the\nsteps, please open a new discussion (not an issue).\n\n\u003e ⚠️ The contributors of Nessie takes no responsibility for any dataloss which\n\u003e might occur, so make sure to back up all existing data in your databases\n\u003e before migrating and test it locally before executing any changes to your\n\u003e production environment.\n\n1. Back up existing data\n2. Update the `nessie.config.ts` file to the new syntax (see the\n   [examples](./examples) folder)\n3. (Skip this step if you already updated the timestamps) Run the\n   `update_timestamps` command from the CLI to update the migration file names\n   and database entries (only the `nessie_migrations` table). Use the latest\n   version of Nessie e.g.\n\n   ```shell\n   deno run -A --unstable https://deno.land/x/nessie@2.0.0/cli.ts update_timestamps\n   ```\n4. Update all imports of Nessie to the latest version in your migration and seed\n   files\n5. Update the migration and seed files to use the new format (class based\n   migration files)\n\nIf you come across any issues, you can open a new discussion on GitHub.\n\n## Contributing\n\nAll contributions are welcome, make sure to read the\n[contribution guideline](./.github/CONTRIBUTING.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhalvardssm%2Fdeno-nessie","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhalvardssm%2Fdeno-nessie","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhalvardssm%2Fdeno-nessie/lists"}