4 ms·
Hi, and thank you! I could see it happening. Of course it would be in addition to sql, not to replace it. First, prql would need to support insert and update
by lovasoa 3y ago
Hi, and thank you!
I could see it happening. Of course it would be in addition to sql, not to replace it. First, prql would need to support insert and update statements, though.
- snthpy 3y ago> Of course it would be in addition to sql, not to replace it. Yes, absolutely! PRQL supports having a version and target header in the first line so you could make that mandatory for PRQL queries and only if it finds that then it routes it to the prql-compiler. Here's an example header: prql version:"0.8.1" target:sql.postgres > First, prql would need to support insert and update statements, though. Ah, I didn't spot that in your README examples. We don't have any plans to support those at the moment. PRQL aims to be an excellent query language and to focus on that solely (unix philosophy and all that). What do you need inserts and updates for? To make a full CRUD app? It might be convenient just to support PRQL for the query and Read parts and leave the CUD to SQL, if you felt so inclined of course. Anyway, thanks for the reply. I'll play around with SQLPage for a bit and then we can chat again.
- lovasoa 3y agoI will add an example to the README with an INSERT statement to make it more obvious what SQLPage can do. For the header, I don't think that would be necessary. SQLPage would route queries to .sql pages to the SQL parser and queries to .prql files to the prql parser. If you want to play around with integrating prql in sqlpage, you can have a look at https://github.com/lovasoa/SQLpage/blob/main/src/webserver/database/sql.rs https://github.com/lovasoa/SQLpage/blob/main/src/webserver/d... This is a short self-contained rust file, and think you would not need to change anything more to interface with a prql parser. If you want to give it a stab, feel free to make a POC and get in touch :)