-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
api: spannerIssues related to the Spanner API.Issues related to the Spanner API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.‘Nice-to-have’ improvement, new feature or different behavior or design.
Description
Having to do:
from google.cloud import spanner
from google.cloud.proto.spanner.v1 import type_pb2
instance = spanner_client.instance(instance_id)
database = instance.database(database_id)
params = {
'start': start,
'end': end
}
param_types = {
'start': type_pb2.Type(code=type_pb2.STRING),
'end': type_pb2.Type(code=type_pb2.STRING)
}
results = database.execute_sql(
"SELECT AlbumId, AlbumTitle, MarketingBudget "
"FROM Albums@{FORCE_INDEX=AlbumsByAlbumTitle} "
"WHERE AlbumTitle >= @start AND AlbumTitle < @end",
params=params, param_types=param_types)Is rather awkward, it would be much more friendly to have:
from google.cloud import spanner
instance = spanner_client.instance(instance_id)
database = instance.database(database_id)
params = {
'start': start,
'end': end
}
param_types = {
'start': spanner.ParamTypes.STRING,
'end': spanner.ParamTypes.STRING
}
results = database.execute_sql(
"SELECT AlbumId, AlbumTitle, MarketingBudget "
"FROM Albums@{FORCE_INDEX=AlbumsByAlbumTitle} "
"WHERE AlbumTitle >= @start AND AlbumTitle < @end",
params=params, param_types=param_types)or similar
mnbbrown
Metadata
Metadata
Assignees
Labels
api: spannerIssues related to the Spanner API.Issues related to the Spanner API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.‘Nice-to-have’ improvement, new feature or different behavior or design.