Use Dialects Enum instead of literals
See original GitHub issueWe hardcode a dialect literal everywhere for example: “clickhouse” in:
- sqlglot.transpile(query, read=“clickhouse”)
- sqlglot.parse_one(query, read=“clickhouse”)
- parsed_query.sql(dialect=“clickhouse”)
I think the best approach to use a Enum for all sqlglot dialects
For example:
from sqlglot import DialectType
- sqlglot.transpile(query, read=DialectType.CLICKHOUSE)
- sqlglot.parse_one(query, read=DialectType.CLICKHOUSE)
- parsed_query.sql(dialect=DialectType.CLICKHOUSE)
@tobymao What do you think about it? Is it the good idea?
Issue Analytics
- State:
- Created a year ago
- Comments:17 (15 by maintainers)
Top Results From Across the Web
Literal types and Enums - mypy 0.991 documentation
Literal types may contain one or more literal bools, ints, strs, bytes, and enum values. However, literal types cannot contain arbitrary expressions: types...
Read more >13 Alternatives to enums in TypeScript
An enum maps member names to member values. If we don't need or want the indirection, we can use a union of so-called...
Read more >Why use Enums instead of Constants? Which is better in ...
Enums limit you to the required set of inputs whereas even if you use constant strings you still can use other String ...
Read more >Choosing Between TypeScript String Literals and Enums
In this web development tutorial we look at the differences between TypeScript String Literal Unions and enums. Learn more.
Read more >TypeScript string enums, and when and how to use them
Specifying enum member values Values are initialized implicitly via number literals, or explicitly via string literals. Constant enum members: ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
not yet, maybe next month, for now you can hit me up on discord directly captaintobs#2594
Oops, sorry. I see I’m late to the party. Don’t mind me…