RobinBlomberg / kysely-codegen

Generate Kysely type definitions from your database.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`--print` command line argument doesn't work

glacius-mitchell opened this issue · comments

Problem description

Invoking the CLI with --print doesn't actually print the generated output file to the terminal.

Identified cause

I believe the issue is that Cli.generate is not propagating options.print to the underlying await generator.generate({ ... }) call, meaning the generator is always receiving print: undefined regardless of what was specified on the command line:

await generator.generate({
camelCase,
db,
dialect,
excludePattern,
includePattern,
logger,
outFile,
runtimeEnums,
schema,
typeOnlyImports,
verify: options.verify,
});

Proposed fix

Assuming that's the case, the fix should be as simple as adding print: options.print to the function call above.

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

Thanks for reporting! I fixed it now in 0.14.2!

Thanks for the quick response! I just downloaded 0.14.2 and can confirm that --print now works as expected.