You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With an alias associated to a table, the insert query will use the table alias instead of its actual name.
How to reproduce
// Call this with an open DB connectionQB::table(['table' => 't'])->insert(['data' => 33]);
Actual result (MySQL)
PHP Fatal error: Uncaught PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'schema.t' doesn't exist
with generated SQL
INSERT INTO `t` (`data`) VALUES (?)
Expected result
The full « table » name is used in the INSERT INTO query, such as:
INSERT INTO `table` (`data`) VALUES (?)
Use case It also affects updateOrInsert(), which is a great helper that can be used on complex queries, where table aliases are really convenient.
Sorry, my use case is wrong, updateOrInsert() doesn't support joins, I don't know why I thought it would have. So this issue doesn't really matter, but it still feels like it should be addressed, for consistency.
The text was updated successfully, but these errors were encountered:
With an alias associated to a table, the insert query will use the table alias instead of its actual name.
How to reproduce
Actual result (MySQL)
with generated SQL
Expected result
The full « table » name is used in the
INSERT INTO
query, such as:Use case
It also affectsupdateOrInsert()
, which is a great helper that can be used on complex queries, where table aliases are really convenient.Sorry, my use case is wrong,
updateOrInsert()
doesn't support joins, I don't know why I thought it would have. So this issue doesn't really matter, but it still feels like it should be addressed, for consistency.The text was updated successfully, but these errors were encountered: