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

Bug in runtime enums #150

Open
mariandaniel24 opened this issue Apr 12, 2024 · 1 comment
Open

Bug in runtime enums #150

mariandaniel24 opened this issue Apr 12, 2024 · 1 comment

Comments

@mariandaniel24
Copy link

mariandaniel24 commented Apr 12, 2024

Hello, in regard to the implementation of runtime enums in #115 , I believe there is a bug with the generated keys.
So, given this SQL

CREATE TYPE risk_evaluation_status AS ENUM ('OK', 'CAN_USE', 'SHOULD_NOT_BE_USED');

When I generate types using kysely-codegen --camel-case --runtime-enums --dialect=postgres --out-file=generated/db-types.ts:

The output is:

// It generates this
export enum RiskEvaluationStatus {
	CANUSE = 'CAN_USE',
	OK = 'OK',
	SHOULDNOTBEUSED = 'SHOULD_NOT_BE_USED',
}

// It should actually generate
export enum RiskEvaluationStatus {
	CAN_USE = 'CAN_USE',
	OK = 'OK',
	SHOULD_NOT_BE_USED = 'SHOULD_NOT_BE_USED',
}

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
@michael-land
Copy link

Encountering the same issue.

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

No branches or pull requests

2 participants