Preql icon indicating copy to clipboard operation
Preql copied to clipboard

Does it support Updates, Deletes?

Open mercurial-moon opened this issue 8 months ago • 5 comments

I see that Preql seems to be heavily geared towards SELECT statements, do you plan to support UPDATE, DELETE etc. i.e the CUD parts of CRUD?

mercurial-moon avatar Mar 04 '25 08:03 mercurial-moon

It actually does support basic CRUD operations. See here for example: https://github.com/erezsh/reladiff/blob/master/dev/prepare_db.pql

Right now Preql isn't under active development. I have some ideas of making a new version in the future, but no definite plans.

erezsh avatar Mar 04 '25 09:03 erezsh

@erezsh ok thanks for the update! I was trying to compare Preql with PRQL, i think PRQL only does selects... is Preql usable in its current state?

mercurial-moon avatar Mar 04 '25 17:03 mercurial-moon

Yes, for simple operations it's definitely usable. And if you run into any bugs, I'll do my best to fix them.

But keep in mind you'll probably run into small bumps in the road, especially if you try fancy stuff.

erezsh avatar Mar 04 '25 17:03 erezsh

@erezsh Ok thanks... and in case we need to call functions (internal or user defined) in postgres will Preql pass them to the underlying DB?

mercurial-moon avatar Mar 05 '25 02:03 mercurial-moon

Yes, it should work using the SQL() escape hatch. See here: https://preql.readthedocs.io/en/latest/tutorial.html#the-sql-escape-hatch

erezsh avatar Mar 05 '25 07:03 erezsh