-
Notifications
You must be signed in to change notification settings - Fork 409
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove multiplicity from
QueryUnit.sql
(#7985)
Currently, `QueryUnit.sql` is a tuple representing, possibly, multiple SQL statements corresponding to the original EdgeQL statement. This introduces significant complexity to consumers of `QueryUnit`, which are mostly unprepared to handle more than one SQL statement anyway. Originally the SQL tuple was used to represent multiple EdgeQL statements, a task which is now handled by the `QueryUnitGroup` stuff. Another use case are the non-transactional commands (`CREATE BRANCH` and friends). Finally, since this facility was available, more uses of it were added without actually _needing_ be executed as multiple SQL statements with no other recourse: those are mostly maintenance commands and the DDL type_id readback. I think the above uses are no longer a sufficient reason to keep the tuple complexity and so I'm ripping it out here, making `QueryUnit.sql` a `bytes` property with the invariant of _always_ containing exactly one SQL statement and thus not needing any special handling. The users are fixed up as follows: - Non-transactional branch units encode the extra SQL needed to represent them in the new `QueryUnit.db_op_trailer` property which is a tuple of SQL. Branch commands have special handling for them already, so this is not a nuisance. - The newly-added type id mappings produced by DDL commands are now communicated via the new "indirect return" mechanism, whereby a DDL PLBlock can communicate a return value via a specially-formatted `NoticeResponse` message. - All other unwitting users of multi-statement `QueryUnit` are converted to use a single statement instead (primarily by converting them to use a `DO` block).
- Loading branch information
Showing
16 changed files
with
690 additions
and
568 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.