-
Notifications
You must be signed in to change notification settings - Fork 16
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
Allow pretending for DDL statements #162
Allow pretending for DDL statements #162
Conversation
Co-authored-by: Takayasu Oyama <taka.oyama@gmail.com>
Co-authored-by: Takayasu Oyama <taka.oyama@gmail.com>
Co-authored-by: Takayasu Oyama <taka.oyama@gmail.com>
|
||
if(count($queries)) | ||
$connection->runDdlBatch($queries); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These fixes don't belong in this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ye fair i merged from the other drop-all branch into this
@@ -295,6 +295,10 @@ public function statement($query, $bindings = []): bool | |||
} | |||
|
|||
// is DDL Query | |||
// allow pretending for DDL queries | |||
if($this->pretending()) | |||
return $this->affectingStatement($query, $bindings) !== null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think runDdlBatch should be fixed to handle the pretending instead of forwarding it to affectingStatement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but isnt affectingStatement()s implementation of pretend
is basically complete and simple and i would just end up duplicating affectingStatement() line for line, except for this range of lines
https://github.com/colopl/laravel-spanner/blob/master/src/Connection.php#L313-L323
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or is nothing in the affectingStatement method relevant?
Fixed in #170. |
If the Connection is pretending, the DDL statements should not run
Since affectingStatement already handles pretending, its fine to just pass through to that method which will return 0 as normal, allowing the generated SQL to be captured