feat: support for Bun
This commit is contained in:
parent
c284cc48d1
commit
ce6946cac4
25 changed files with 111 additions and 2 deletions
|
|
@ -29,6 +29,11 @@ It then sorts the migrations by filename in ascending order and outputs them and
|
|||
yarn emigrate list [options]
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem label="bun">
|
||||
```bash
|
||||
bunx --bun emigrate list [options]
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem label="package.json">
|
||||
```json {3}
|
||||
{
|
||||
|
|
|
|||
|
|
@ -28,6 +28,11 @@ The migration file can be based on a template, generated by a <Link href="/plugi
|
|||
yarn emigrate new [options] <name>
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem label="bun">
|
||||
```bash
|
||||
bunx --bun emigrate new [options] <name>
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem label="package.json">
|
||||
```json {3}
|
||||
{
|
||||
|
|
|
|||
|
|
@ -26,6 +26,11 @@ The `remove` command is used to remove a migration from the history. This is use
|
|||
yarn emigrate remove [options] <name>
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem label="bun">
|
||||
```bash
|
||||
bunx --bun emigrate remove [options] <name>
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem label="package.json">
|
||||
```json {3}
|
||||
{
|
||||
|
|
|
|||
|
|
@ -31,6 +31,11 @@ If any of the migrations fail, the command will be aborted and the rest of the m
|
|||
yarn emigrate up [options]
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem label="bun">
|
||||
```bash
|
||||
bunx --bun emigrate up [options]
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem label="package.json">
|
||||
```json {3}
|
||||
{
|
||||
|
|
|
|||
|
|
@ -35,6 +35,11 @@ But for now, this is the way to go.
|
|||
yarn add @emigrate/cli
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem label="bun">
|
||||
```bash
|
||||
bun add @emigrate/cli
|
||||
```
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
### Pick a storage plugin
|
||||
|
|
@ -59,6 +64,11 @@ Install the plugin you want to use, for example the <Link href="/plugins/storage
|
|||
yarn add @emigrate/postgres
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem label="bun">
|
||||
```bash
|
||||
bun add @emigrate/postgres
|
||||
```
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
### Create your first migration
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import Link from '@components/Link.astro';
|
|||
Emigrate is written in [TypeScript](https://www.typescriptlang.org) and is a migration tool for any database or data.
|
||||
|
||||
* It's database agnostic - you can use it with any database, or even with non-database data.
|
||||
* It can be run on multiple platforms - currently [NodeJS](https://nodejs.org) and [Bun](https://bun.sh) is supported, but more platforms is planned.
|
||||
* It's the successor of [klei-migrate](https://github.com/klei/migrate) and is designed to be compatible with [Immigration](https://github.com/blakeembrey/node-immigration) and many of its storage plugins, as well as [Migrate](https://github.com/tj/node-migrate).
|
||||
* It supports migration files written using <Link href="/plugins/loaders/default/">CommonJS or ES Modules out of the box</Link>, with any of the following extensions: `.js`, `.cjs` or `.mjs`, and supports [async functions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function), [Promises](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) or using the [NodeJS Callback Pattern](https://nodejs.org/en/learn/asynchronous-work/javascript-asynchronous-programming-and-callbacks#handling-errors-in-callbacks).
|
||||
* Other languages can be used by using a <Link href="/plugins/loaders/">Loader Plugin</Link>.
|
||||
|
|
|
|||
|
|
@ -25,6 +25,11 @@ A <Link href="/plugins/generators/">generator plugin</Link> for generating new m
|
|||
yarn add @emigrate/plugin-generate-js
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem label="bun">
|
||||
```bash
|
||||
bun add @emigrate/plugin-generate-js
|
||||
```
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
## Usage
|
||||
|
|
|
|||
|
|
@ -25,6 +25,11 @@ The MySQL generator creates new migration files with the `.sql` extension. In th
|
|||
yarn add @emigrate/mysql
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem label="bun">
|
||||
```bash
|
||||
bun add @emigrate/mysql
|
||||
```
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
## Usage
|
||||
|
|
|
|||
|
|
@ -25,6 +25,11 @@ The PostgreSQL generator creates new migration files with the `.sql` extension.
|
|||
yarn add @emigrate/postgres
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem label="bun">
|
||||
```bash
|
||||
bun add @emigrate/postgres
|
||||
```
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
## Usage
|
||||
|
|
|
|||
|
|
@ -25,6 +25,11 @@ The MySQL loader plugin transforms `.sql` files into JavaScript functions that E
|
|||
yarn add @emigrate/mysql
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem label="bun">
|
||||
```bash
|
||||
bun add @emigrate/mysql
|
||||
```
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
## Configuration
|
||||
|
|
|
|||
|
|
@ -25,6 +25,11 @@ The PostgreSQL loader plugin transforms `.sql` files into JavaScript functions t
|
|||
yarn add @emigrate/postgres
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem label="bun">
|
||||
```bash
|
||||
bun add @emigrate/postgres
|
||||
```
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
## Configuration
|
||||
|
|
|
|||
|
|
@ -27,6 +27,11 @@ This is useful in production environments where you want all logs as JSON, which
|
|||
yarn add @emigrate/reporter-pino
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem label="bun">
|
||||
```bash
|
||||
bun add @emigrate/reporter-pino
|
||||
```
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
## Usage
|
||||
|
|
|
|||
|
|
@ -29,6 +29,11 @@ This is suitable for simple setups, but for more advanced setups for instance wh
|
|||
yarn add @emigrate/storage-fs
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem label="bun">
|
||||
```bash
|
||||
bun add @emigrate/storage-fs
|
||||
```
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
## Configuration
|
||||
|
|
|
|||
|
|
@ -25,6 +25,11 @@ The MySQL storage plugin uses a MySQL database to store the migration history (*
|
|||
yarn add @emigrate/mysql
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem label="bun">
|
||||
```bash
|
||||
bun add @emigrate/mysql
|
||||
```
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
## Configuration
|
||||
|
|
|
|||
|
|
@ -25,6 +25,11 @@ The PostgreSQL storage plugin uses a PostgreSQL database to store the migration
|
|||
yarn add @emigrate/postgres
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem label="bun">
|
||||
```bash
|
||||
bun add @emigrate/postgres
|
||||
```
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
## Configuration
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue