-
Notifications
You must be signed in to change notification settings - Fork 33
Description
Hi!
I'd like to know which strategy should be applied in order to create and insert primary keys using python-spanner-sqlalchemy, since the standard documentation recommends against the usage of auto-increment ids, although looking into the library's samples I've come across the following row insertion snippet:
def insert_row(connection, table): """Insert row into the table. The table must already exist and can be created usingcreate_table.`
"""
connection.execute(table.insert(), {"user_id": 1, "user_name": "ABC"})
row = list(connection.execute(table.select()))
print("Inserted row: ", row)
`
That resembles the usage of auto-increment primary keys in SQLAlchemy's documentation, but being migrating from a regular database provider (Postgres), I don't know if it would be a good practice to just translate the current tables with auto-increment indexes to Cloud Spanner.