-
-
Notifications
You must be signed in to change notification settings - Fork 2k
[NFR] Query builder for raw sql #2052
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
Comments
Yep. I also want this feature. Using plain string to build raw sql in phalcon is annoying and error prone. |
+1 |
+1 |
2 similar comments
+1 |
+1 |
+10 |
+1000 |
👍 However with sub selects coming to PHQL in |
+1 |
1 similar comment
+1 |
Actually standard query builder ALMOST allows to build raw sql, it just wraps table's name with square brackets. example: result: SELECT [table].* FROM [table] WHERE a = "a" LIMIT 1 |
+1 |
+100 |
+1 |
+1 Edited: Actually I voted because I thought it was a new raw_query for the query builder. I know it is error prone but actually it's the unique way to do some complex queries. It would be great to have a queryBuilder->rawQuery (actually I need it or I'm stuck on complex raw transformations etc on the ORM) |
+1 |
5 similar comments
+1 |
+1 |
+1 |
+1 |
+1 |
1+ |
1 similar comment
1+ |
Closing in favor of #13855. Will revisit if the community votes for it, or in later versions. |
@hugoduraes and others, How do you envision this to work i.e. what would the result be? Is it going to be an array just like Since this issue has the most votes I was thinking of taking a stab at it and tying it with the new ORM that we are building but also offering functionality for the current ORM. |
Implemented in #14734 |
It would be nice to have a query builder for raw sql queries, similar to Zend_Db_Select:
http://framework.zend.com/manual/1.12/en/zend.db.select.html
This would be useful when you need to build select queries which rely on specific SQL extensions that aren’t supported by PHQL.
The syntax should be similar to the creation of queries using the Query Builder:
http://docs.phalconphp.com/en/latest/reference/phql.html#creating-queries-using-the-query-builder
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: