Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deno workflow. #17

Merged
merged 1 commit into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 52 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ jobs:
with:
version: 9

- name: Use Node.js ${{ matrix.node-version }}
- name: Use Node.js 22
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
node-version: 22
cache: "pnpm"

- uses: oven-sh/setup-bun@v1
Expand Down Expand Up @@ -106,3 +106,53 @@ jobs:
- name: kysely migrate:rollback --all
working-directory: examples/bun
run: bun --bun kysely migrate:rollback --all --debug

deno:
runs-on: ubuntu-latest

name: ubuntu-latest + Deno

steps:
- uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Use Node.js 22
uses: actions/setup-node@v4
with:
node-version: 22
cache: "pnpm"

- uses: denoland/setup-deno@v1
with:
deno-version: vx.x.x

- name: Install dependencies
run: pnpm i && pnpm build && cd examples/deno-package-json && deno cache .config/kysely.config.ts && cd ../.. && pnpx tsx ./scripts/localize-deno-dependency.mts

- name: Run docker compose
working-directory: examples/deno-package-json
run: docker compose up -d

- name: kysely -v
working-directory: examples/deno-package-json
run: deno task kysely -v

- name: kysely migrate:make <migration-name>
working-directory: examples/deno-package-json
run: deno task kysely migrate:make moshe --debug

- name: kysely migrate:list
working-directory: examples/deno-package-json
run: deno task kysely migrate:list --debug

- name: kysely migrate:latest
working-directory: examples/deno-package-json
run: deno task kysely migrate:latest --debug

- name: kysely migrate:rollback --all
working-directory: examples/deno-package-json
run: deno task kysely migrate:rollback --all --debug
36 changes: 35 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,41 @@ bun add -D kysely-ctl

### Deno

Yes.
Add `kysely-ctl` to your `package.json`:

```json
{
...
"scripts": {
...
"kysely": "kysely", // allows running commands with `deno task kysely ...`
...
},
...
"devDependencies": {
...
"kysely-ctl": "^0.8.3"
...
},
...
}
```

Running the following:

```bash
deno cache <some_file>
```

will install `kysely-ctl` in a `node_modules` folder.

> [!WARNING]
> It's complicated.
>
> We use `c12` for configuration file loading, which uses `jiti` to load `.ts` files.
`jiti` doesn't support `deno` [yet](https://github.com/unjs/jiti/issues/168). If your config file has `Deno`-native URL imports,
specifiers (e.g. `npm:`, `jsr:`), import map resolution, it won't work.
This means you can't use `kysely-ctl` with `SQLite` on `Deno`, as it requires a `Deno`-native `SQLite` library - `Deno` doesn't support `better-sqlite3` [yet](https://github.com/denoland/deno/issues/18444).

## Use

Expand Down
Loading