-
Notifications
You must be signed in to change notification settings - Fork 33
Closed
Labels
api: spannerIssues related to the googleapis/python-spanner-sqlalchemy API.Issues related to the googleapis/python-spanner-sqlalchemy API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
Environment details
- Programming language:
python
- OS:
13.4 (22F66)
- Language runtime version:
3.11
- Package version:
sqlalchemy-spanner==1.6.1
SQLAlchemy==2.0.15
Steps to reproduce
- Create an update/insert statement
update_stmt = (
update(DBModel)
.values(
**db_record.dict(exclude_none=True)
)
.where(
DBModel.number == db_record.number
)
.returning(DBModel.unique_id)
)
- Generated SQL statement
UPDATE
db_table
SET
db_col.value = :db_schema_col_value
WHERE
db_table.number = :db_schema_col_number
RETURNING
db_table.unique_id
- Expected GoogleSQL statement
ref: https://cloud.google.com/spanner/docs/reference/standard-sql/dml-syntax#insert-and-then-return
UPDATE
db_table
SET
db_col.value = :db_schema_col_value
WHERE
db_table.number = :db_schema_col_number
THEN RETURN
db_table.unique_id
andrii-harbour
Metadata
Metadata
Assignees
Labels
api: spannerIssues related to the googleapis/python-spanner-sqlalchemy API.Issues related to the googleapis/python-spanner-sqlalchemy API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.