Class: Google::Cloud::Spanner::Project

Inherits:
Object
  • Object
show all
Defined in:
lib/spanner_client_ext.rb

Instance Method Summary collapse

Instance Method Details

#create_session(instance_id, database_id, labels: nil) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/spanner_client_ext.rb', line 12

def create_session instance_id, database_id, labels: nil
  ensure_service!

  grpc = @service.create_session(
    Admin::Database::V1::DatabaseAdmin::Paths.database_path(
      project: project, instance: instance_id, database: database_id
    ),
    labels: labels
  )
  Session.from_grpc grpc, @service
end