sql-query-identifier icon indicating copy to clipboard operation
sql-query-identifier copied to clipboard

Replace Dialect and ExecutionType types as enums

Open MasterOdin opened this issue 4 years ago • 0 comments

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.

MasterOdin avatar Oct 05 '21 23:10 MasterOdin