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

QueryBuilder - Does not support JOIN in UPDATE #2799

Closed
najdanovicivan opened this issue Apr 4, 2020 · 4 comments
Closed

QueryBuilder - Does not support JOIN in UPDATE #2799

najdanovicivan opened this issue Apr 4, 2020 · 4 comments

Comments

@najdanovicivan
Copy link
Contributor

I see in database classes that there's no support for update with joins.

More info here:
MYSQL - https://www.mysqltutorial.org/mysql-update-join/
PostgreSQL - Does Not Support It
SQLite - Does Not Support It
MSSQL - https://www.sqlshack.com/an-overview-of-sql-server-update-join/

The same feature lack on CI3 as well bcit-ci/CodeIgniter#5941

@otrelin
Copy link
Contributor

otrelin commented Apr 5, 2020

QueryBuilder provides the ability to work with any database. If this feature is not supported in all databases, then QueryBuilder cannot provide it for everyone. Any time You can switch from one database to another and your code still working.
You can use custom queries instead.

@nowackipawel
Copy link
Contributor

nowackipawel commented Apr 5, 2020 via email

@najdanovicivan
Copy link
Contributor Author

Regadring the CI4 it should not be that hard to implement as it only needs to be implemented in MySQL driver. I've created the issue for reference here. I will work on that and submit PR

@lonnieezell
Copy link
Member

The same thing can be accomplished with Postgres so a way to do that would also have to be implemented. Additionally, a way of dealing with it in SQLite would need to be handled if at all possible since SQLite is often used for running tests even when the site would use MySQL or Postgres. So, it's not as simple as it seems.

Additionally, the goal with the Query Builder is to provide a consistent API across all database drivers that we support. We avoid adding any engine-specific functions to the Builder, since you can still hand-write queries for anything more specific needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants