RobinBlomberg / kysely-codegen

Generate Kysely type definitions from your database.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Deno support

harastaivan opened this issue · comments

Hello,
I tried to use kysely-codegen with Deno. Since kysely supports Deno, I thought kysely-codegen will work too.

I ran:

deno run npm:kysely-codegen

It outputs:

• Loaded environment variables from .env file.
• No dialect specified. Assuming 'postgres'.

But it seems it doesn't do anything. Could you test it and possibly help me what's the problem? I'm happy to help with investigation but need some guide

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar

I was able to run like this on deno.json:

"tasks": {
	"kysely-codegen": "echo \"import 'npm:pg@^8.11.3'; import 'npm:kysely-codegen@^0.11.0';\" | deno run --allow-env -A npm:kysely-codegen@^0.11.0 - kysely-codegen --dialect=postgres --out-file ./src/database-types.ts --env-file .env"
},

Or try to cache required package before run codegen:

deno cache npm:pg && deno run -A npm:kysely-codegen --out-file=./db_schema.ts