-
Notifications
You must be signed in to change notification settings - Fork 439
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
docs: Added additional docs for executeUpdate #2269
docs: Added additional docs for executeUpdate #2269
Conversation
* Added notes that executeUpdate should be used for insert, update and delete statements, which should help quick searching of the docs. * Added an example update using a struct * Added links in the docs to DML guide
Hey @jsimonweb - based on your PR in #2121, we wanted to improve our docs and snippets for our Spanner classes. I've added links to the DML guide, added notes that users can perform INSERT, UPDATE and DELETE statements via our |
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.
Did you verify that the struct example works against a real database schema and data?
Spanner/src/Transaction.php
Outdated
* rows). | ||
* rows). For example, DML supports INSERT, UPDATE and DELETE statements. For | ||
* more on DML syntax, visit the DML syntax guide. | ||
* {@see https://cloud.google.com/spanner/docs/dml-syntax} |
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.
Move this down near line 363. URLs in the doc text should be formatted as markdown.
Spanner/src/Transaction.php
Outdated
* @codingStandardsIgnoreStart | ||
* |
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.
remove empty line.
Argument::withEntry('params', $expectedParams), | ||
Argument::withEntry( | ||
'paramTypes', | ||
Argument::withEntry('post', Argument::withEntry('structType', $expectedStructData)) |
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.
you can assert on nested array data? cool! TIL.
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.
Yeah! I found an example someone in phpspec, I'll send it to you if I can find it again.
Codecov Report
@@ Coverage Diff @@
## master #2269 +/- ##
========================================
Coverage 92.6% 92.6%
Complexity 4467 4467
========================================
Files 307 307
Lines 13323 13323
========================================
Hits 12338 12338
Misses 985 985
Continue to review full report at Codecov.
|
Co-Authored-By: John Pedrie <[email protected]>
Co-Authored-By: John Pedrie <[email protected]>
Co-Authored-By: John Pedrie <[email protected]>
Co-Authored-By: John Pedrie <[email protected]>
Co-Authored-By: John Pedrie <[email protected]>
This is specifically what I ran and tested against a real dataset:
|
Co-Authored-By: John Pedrie <[email protected]>
Co-Authored-By: John Pedrie <[email protected]>
… into spanner-struct-and-dml-doc
…lgsims/google-cloud-php into spanner-struct-and-dml-doc
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.
One small nit, otherwise looks nice.
Spanner/src/Transaction.php
Outdated
* "WHERE STRUCT<Title STRING, Content STRING>(Title, Content) = @post"; | ||
* | ||
* $postValue = new StructValue(); | ||
* $postValue->add('Title', 'Updated Title'); |
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.
This seems like a pretty nice opportunity to use the fluent interface.
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.
For sure! How does this look? Would you rather go all-the-way with (new StructValue())->add()->add()
?
and delete statements, which should help quick searching of the
docs.