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

PostgreSQL support for With Queries in SQL #1125

Closed
didiergm opened this issue Oct 11, 2018 · 1 comment
Closed

PostgreSQL support for With Queries in SQL #1125

didiergm opened this issue Oct 11, 2018 · 1 comment

Comments

@didiergm
Copy link

didiergm commented Oct 11, 2018

A few months back I had the need for the SQL layer to accept a WITH Common table expression , unfortunately I constantly received a ssyntax error (not sure of the exact message) when using exec.

After chatting on gitter, I ended up modifying sql.php, line 238


if (preg_match('/(?:^[\s\(]*'.
	'(?:EXPLAIN|SELECT|PRAGMA|SHOW)|RETURNING)\b/is',$cmd) ||
	(preg_match('/^\s*(?:CALL|EXEC)\b/is',$cmd) &&
into this version: 
if (preg_match('/(?:^[\s\(]*'.
'(?:EXPLAIN|SELECT|PRAGMA|SHOW|WITH)|RETURNING)\b/is',$cmd) ||
(preg_match('/^\s*(?:CALL|EXEC)\b/is',$cmd) &&

I have been running for a few months with this modified version and have not seen any side effects.

I do not know how to make a pr, so being very simple I thought I would share it here

@ikkez
Copy link
Collaborator

ikkez commented Oct 11, 2018

Thanks, but it has already been added recently, see f3-factory/fatfree-core@8fd940b
so it'll be in the next release.
ref. #1021, #1107, #1116

@ikkez ikkez closed this as completed Oct 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants