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

Support for special syntaxes for example in SQL_MODE='ORACLE' #425

Open
calebdw opened this issue Mar 4, 2023 · 3 comments
Open

Support for special syntaxes for example in SQL_MODE='ORACLE' #425

calebdw opened this issue Mar 4, 2023 · 3 comments
Labels
bug enhancement kind/support A request for adding support

Comments

@calebdw
Copy link

calebdw commented Mar 4, 2023

Hello!

I know this library is primarily for MySQL dialects, but this is the only PHP SQL parser I could find...

This can't parse the 'custom' Postgres dump, but I found it can sort of parser the plain text format with varying results.

The parser seems to stop after the first timestamp column (it parsed created_at) so I have a bunch of table create statements with only two columns:

CREATE TABLE public.urls (
    id integer NOT NULL,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    long_url text NOT NULL
);

Any ideas why?

Thanks!

@williamdes
Copy link
Member

Hi!
That's interesting, probably out of the scope of the parser unless MariaDB has a postgres sql compatibility mode?

Tehy already do have compatibility for sql server things
or supports the without time zone?
Can you research this a bit more before we investigate?

@calebdw
Copy link
Author

calebdw commented Mar 6, 2023

@williamdes, thanks for the response. I ended up implementing a solution that didn't involve parsing Postgres dumps.

I understand if this is out-of-scope and you'd like to close the issue, just figured I raise it in case others experienced the same thing. I dug around a bit but unfortunately this is a little over my head

@williamdes
Copy link
Member

williamdes commented Mar 9, 2023

I understand if this is out-of-scope and you'd like to close the issue, just figured I raise it in case others experienced the same thing. I dug around a bit but unfortunately this is a little over my head

Thank you for reporting ;)

Let's keep this one open so we can check about SET SQL_MODE='ORACLE';: https://mariadb.com/kb/en/sql_modeoracle/

Especially about :param1 query placeholders

See: #202

@williamdes williamdes changed the title Parser fails on Postgres dumps with timezone columns Support for special syntaxes for example in SQL_MODE='ORACLE' Mar 9, 2023
@williamdes williamdes added the kind/support A request for adding support label Apr 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug enhancement kind/support A request for adding support
Projects
None yet
Development

No branches or pull requests

2 participants