Uh oh!
There was an error while loading. Please reload this page.
Added samples for using Cloud SQL with App Engine Python 3.7 Standard - #1672
Conversation
michaelawyu
commented
Aug 30, 2018
The linter only supports Python 2.7 :( |
| import os | ||
| from flask import Flask | ||
| import mysql.connector |
There was a problem hiding this comment.
I think we might be intentionally standardizing on pymysql as it has the largest usage share and is easiest for our users to install. Is there a particular reason to go with mysql connector?
There was a problem hiding this comment.
pymysql does not have built-in support for connection pooling :(
| cursor.execute('SELECT NOW() as now;') | ||
| result = cursor.fetchall() | ||
| current_time = result[0][0] | ||
| cursor.close() |
There was a problem hiding this comment.
The adaptor doesn't support anything like "with" statements (context managers) here, do they?
There was a problem hiding this comment.
I checked the reference and it does not seem to have the __enter__ and __exit__ method.
| result = cursor.fetchall() | ||
| current_time = result[0][0] | ||
| cursor.close() | ||
| # If the connection comes from a pool, close() will send the connection |
googlebot
commented
Oct 10, 2018
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. |
michaelawyu
commented
Oct 10, 2018
@andrewsg Package updated, PTAL. Not sure why the CLA bot is triggered :( |
michaelawyu
commented
Oct 10, 2018
New year resolution: Make the Linter recognize F-string. Everyone should use F-string! |
andrewsg
commented
Oct 11, 2018
CLA bot is due to lack of github tag in some commits for Chen, should be resolved going forward |
Pending approval of the new doc page.