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

Mysql string date support #230

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bherila
Copy link

@bherila bherila commented Jan 6, 2025

Adds support to the mysql dialect to pass and parse dates as strings rather than js Date objects.

Installed locally.

bwh@Bens-Laptop bwh % yarn introspect              
yarn run v1.22.22
$ kysely-codegen --env-file=./.env.local --out-file=./src/server_lib/kysely.d.ts --date-parser=string
• Loaded environment variables from './.env.local'.
• No dialect specified. Assuming 'mysql'.
• Introspecting database...
✓ Introspected 37 tables and generated ./src/server_lib/kysely.d.ts in 213ms.

✨  Done in 0.73s.

Verified DATETIME columns are now generated like:

  when_added: Generated<string | null>;
  when_deleted: Generated<string | null>;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant