kayak / pypika

PyPika is a python SQL query builder that exposes the full richness of the SQL language using a syntax that reflects the resulting query. PyPika excels at all sorts of SQL queries but is especially useful for data analysis.
http://pypika.readthedocs.io/en/latest/
Apache License 2.0
2.52k stars 296 forks source link

A way to specify the enclosing character #816

Open simonaubertbd opened 1 month ago

simonaubertbd commented 1 month ago

Hello,

Reading the documentation and in the examples, the enclosing character is always "

https://pypika.readthedocs.io/en/latest/2_tutorial.html

SELECT "history".* FROM "history" JOIN "customers" ON "history"."customer_id"="customers"."id" WHERE "customers"."id"=5

However, it may differ in many databases such as Apache Hive where it 's a backtick.

Therefore, I would like a way to specify this enclosing character.

Best regards,

Simon

maen-allaga commented 1 month ago

@simonaubertbd (I'm not a maintainer, so take my answer with a grain of salt please). I believe what you're asking for is a new Dialect

simonaubertbd commented 1 month ago

@maen-allaga Hello and thanks for your answer. Not exactly. For me, it should work that way : -dedicated dialectS. Enclosing character is well specified. -generic dialect (some kind of "default" one). Enclosing character is by default the double quote but the user has the ability to specify another one.

Moreoever, I'm not sure that now, the enclosing character is specified (but I may have missed that in the code).

Best regards,

Simon