gpt4 book ai didi

google-cloud-datastore - 如何将 Google Cloud Datastore 与 Ruby 结合使用?

转载 作者:行者123 更新时间:2023-12-04 04:56:40 24 4
gpt4 key购买 nike

我想从 Rails 应用程序中使用 Google Cloud Datastore。任何 Ruby 库都可以让这一切变得简单?

最佳答案

您可以使用官方的 Google API Client for Ruby:

https://github.com/google/google-api-ruby-client

# Log in
google-api oauth-2-login --client-id='...' --client-secret='...' --scope="https://www.googleapis.com/auth/datastore https://www.googleapis.com/auth/userinfo.email"

# Start an interactive API session
google-api irb
>> ds = $client.discovered_api('datastore', 'v1beta1')
>> $client.execute(ds.lookup, {'datasetId' => '...', 'keys' => [...]})
=> # returns a response from the API

关于google-cloud-datastore - 如何将 Google Cloud Datastore 与 Ruby 结合使用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16670048/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com