Hi there! Please sign in
help
tags
users
badges
ALL
UNANSWERED
Ask Your Question
Revision history [
back
]
1
initial version
answered
2022-03-20 17:00:00 +0000
ladyg
21
●
1
●
2
Define your models (Python classes) using SQLAlchemy's declarative syntax.
Create a SQLAlchemy engine that's configured to connect to your Cloud Spanner instance.
Create a session using the SQLAlchemy sessionmaker, passing in the engine you created in step 2.
In your code, query the session to retrieve rows from the database using standard SQLAlchemy syntax.
SQLAlchemy will automatically map the row data to instances of your model classes, giving you rich, object-oriented access to your data.
Use the model instances to manipulate the data and perform any necessary calculations or transformations.
When you're ready to save your changes back to the database, use the session to commit the changes or rollback if there were any errors.
Copyright QStack.ai, 2010-2023. Content on this site is licensed under the Creative Commons Attribution Share Alike 3.0 license.
Please note: QStack requires javascript to work properly, please enable javascript in your browser,
here is how