Skip to content

How to use readonly transaction #97

Closed
@wusendong

Description

I want to execute the query from a database in which my service account has no beginOrRollbackReadWriteTransaction permission, and I use this library with pandas via codes like here:

from sqlalchemy import create_engine
import pandas as pd

engine = create_engine( "spanner:///projects/project_id/instances/instance_id/databases/demo")
pd.read_sql("SELECT * from plans", engine)

And I got a message returns: "Caller is missing IAM permission spanner.databases.beginOrRollbackReadWriteTransaction on resource projects/project_id/instances/instance_id/databases/demo"

So how to use this library to execute some read-only SQL? Because I want only a limited number of people to have write access

Metadata

Assignees

Labels

api: spannerIssues related to the googleapis/python-spanner-sqlalchemy API.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions