We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Would be really useful to have
$this->db->table('table')->replace()
It is the same like INSERT, just with REPLACE is used
Or
$this->db->table('table')->inserOrUpdate($newData, $updateData)
Useful when update should for example increment some column, change date, etc.
Reference: https://dev.mysql.com/doc/refman/8.0/en/replace.html https://dev.mysql.com/doc/refman/8.0/en/insert-on-duplicate.html
The text was updated successfully, but these errors were encountered:
While I agree it would be nice to have, it's too database-vendor specific.
PostgreSQL:
... ON CONFLICT (column) DO ...
FirebirdSQL:
UPDATE OR INSERT INTO table ... MATCHING (column) ...
Implementing MERGE (that is SQL standard) makes more sense. However it seems that MySQL still doesn't support it.
The best, for now, is an ad-hoc query.
Sorry, something went wrong.
No branches or pull requests
Would be really useful to have
It is the same like INSERT, just with REPLACE is used
Or
Useful when update should for example increment some column, change date, etc.
Reference:
https://dev.mysql.com/doc/refman/8.0/en/replace.html
https://dev.mysql.com/doc/refman/8.0/en/insert-on-duplicate.html
The text was updated successfully, but these errors were encountered: