Open botond-veress opened 9 months ago
After further investigation and console.logs, it looks like it creates 2 db.d.ts files. One in the project's node_modules and one in the root. The file in the root node_modules is empty, however, that one is being used in the project is generated correctly:
$ stat -f %z ./node_modules/kysely-codegen/dist/db.d.ts
14128
$ stat -f %z ../../node_modules/kysely-codegen/dist/db.d.ts
21
So the only way this works, if the cli is being run in the project root directory.
Thank you for working on
kysely
. I really love working with it.I found a couple of issues with the codegen cli though: I have a monorepo and I wanted to run
kysely-codegen
in one of the packages, but it doesn't seem to find the dependencies:Please note I already added
mysql2
as a dependency to that project.Also, it looks like the dependency is in the root
node_modules
directory, which is most likely the issue.Then I decided I would add the cli as a dev dependency to overcome the issue:
The installation was successful, but running the CLI generated an empty
db.t.ts
file a couple of times. This is probably a duplicate of #91 .It correctly listed all the tables from the database though. I removed and reinstalled the package, and that solved the issue.
P.S. I use node@18, npx@9.8.1 and yarn@1.22.19 workspaces.
Upvote & Fund