Skip to content

dialect parameter without effect #790

@thmsklngr

Description

@thmsklngr

Hi,
I tried to create a query for MySQL today and found out that regardless I define, the query always looks the same.

Example:

> from pypika import Table, Query, Dialects
> Query.from_('bar', dialect=Dialects.MYSQL).select('foo')
'SELECT "foo" FROM "bar"'

> q = Query.from_('bar').select('foo')
> q.get_sql(dialect=Dialects.MYSQL)
'SELECT "foo" FROM "bar"'

The ony way to get a correct MySQL query is to either use MySQLQuery from pypika.dialects or you use q.get_sql(quote_char='`').

Of course it could be that I may have a wrong understanding of pypika.Dialects, but there's not much explanation out there.

Regards, Thomas

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions