Repository navigation
feat(cloudsqlmysql): add native read-only session locking - #3618
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces read-only mode support for the Cloud SQL MySQL source. It adds a readonly configuration option, configures the database connection pool to enforce read-only sessions via cloudsql_session_read_only=locked when enabled, introduces a prebuilt execute_sql_readonly tool, and adds an integration test to verify the read-only enforcement. The feedback recommends renaming the environment variable CLOUDSQL_MYSQL_READONLY to CLOUD_SQL_MYSQL_READONLY in both the documentation and configuration files to maintain naming consistency with existing environment variables.
a975dc7 to
efeaaa2
Compare
9a2c11a to
67c5006
Compare
efeaaa2 to
c638838
Compare
67c5006 to
1440fd2
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a read-only mode for Cloud SQL MySQL sources, enforcing read-only session locking on the database connection via DSN parameters when enabled. It adds a new execute_sql_readonly tool, updates the configuration and source initialization, and includes an integration test to verify that write operations are rejected in read-only mode. Feedback suggests correcting the README documentation to accurately describe that the readonly option enforces session locking on the connection rather than routing queries to a read-only endpoint.
502e5f9 to
8f59ae2
Compare
c35957e to
a6f8ff1
Compare
8f59ae2 to
2cff425
Compare
a6f8ff1 to
4091cdd
Compare
cc44835 to
bf538b0
Compare
f1f111f to
8b61e58
Compare
bf538b0 to
b058146
Compare
8b61e58 to
a10c055
Compare
b058146 to
3bcf247
Compare
a10c055 to
e5fb97b
Compare
3bcf247 to
f9cc575
Compare
e5fb97b to
ce488fc
Compare
f9cc575 to
50037a4
Compare
ce488fc to
407c689
Compare
50037a4 to
bddc2c0
Compare
407c689 to
6b3b8a6
Compare
|
Hi @shuzhou-gc Checking in to see if the explanations above addressed your questions, or if you have any further thoughts on the approach. If everything looks good, could you please give this an LGTM? Thanks! 🙂 |
rajavi-vivek
left a comment
There was a problem hiding this comment.
Please see comments about clousql_session_readonly
rajavi-vivek
left a comment
There was a problem hiding this comment.
Please see the suggested changes.
rajavi-vivek
left a comment
There was a problem hiding this comment.
Thanks for pulling in the recommended changes.
|
🧨 Preview deployments removed. Cloudflare Pages environments for |
Description
This PR implements native, protocol-level Read-Only session enforcement for Cloud SQL for MySQL.
Changes
&session_variables=cloudsql_session_read_only%3Dlockedto the connection DSN whenreadOnly: trueis configured on the source.ReadOnly booltocloudsqlmysql.Configand implementedIsReadOnly() booloncloudsqlmysql.Source.cloud-sql-mysql.yamlandcloud-sql-mysql-admin.yaml) to dynamically resolve read-only mode via theCLOUDSQL_MYSQL_READONLYenvironment variable (readonly: ${CLOUDSQL_MYSQL_READONLY:false}).