sql-parser
sql-parser copied to clipboard
Support for special syntaxes for example in SQL_MODE='ORACLE'
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!
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?
@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
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