Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8215f45

Browse filesBrowse files
authored
reuse same spanner database in Cloud Function sample (GoogleCloudPlatform#2763)
1 parent 7f0be75 commit 8215f45
Copy full SHA for 8215f45

File tree

Expand file treeCollapse file tree

1 file changed

+2
-3
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-3
lines changed

‎functions/spanner/main.py

Copy file name to clipboardExpand all lines: functions/spanner/main.py
+2-3Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,11 @@
1919
database_id = 'example-db'
2020

2121
client = spanner.Client()
22+
instance = client.instance(instance_id)
23+
database = instance.database(database_id)
2224

2325

2426
def spanner_read_data(request):
25-
instance = client.instance(instance_id)
26-
database = instance.database(database_id)
27-
2827
query = 'SELECT * FROM Albums'
2928

3029
outputs = []

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.