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

Replace Dialect and ExecutionType types as enums #43

Open
MasterOdin opened this issue Oct 5, 2021 · 0 comments
Open

Replace Dialect and ExecutionType types as enums #43

MasterOdin opened this issue Oct 5, 2021 · 0 comments

Comments

@MasterOdin
Copy link
Contributor

Right now we export the Dialect and ExecutionType as string union types. While this works, it would be better to use string enums like:

enum ExecutionType {
  LISTING = 'LISTING',
  MODIFICATION = 'MODIFICATION',
  UNKNOWN = 'UNKNOWN',
};

where we can retain the same type signature where we use ExecutionType currently, but also allow downstream consumers to do stuff like getExecutionType('SELECT') === ExecutionType.LISTING as opposed to getExecutionType('SELECT') === 'LISTING' leading to better type safety.

As this is a BC breaking change, this will need to land in 3.0.

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

1 participant