gpt4 book ai didi

python - GQL 是否与用于谷​​歌应用引擎和谷歌云数据存储的语言相同?

转载 作者:太空宇宙 更新时间:2023-11-04 01:23:07 24 4
gpt4 key购买 nike

我是学习和使用 GQL 的新手。我在这里看到了 GQL 语法:https://developers.google.com/appengine/docs/python/datastore/gqlreference在这里:https://developers.google.com/datastore/docs/concepts/gql_reference .非常相似,但我不完全确定。

例如,Google 应用引擎中的绑定(bind)参数值是这样使用的:

employees_trained = db.GqlQuery("SELECT * FROM Employee WHERE email IN :1",
training_registration_list)

参数前带有“:”,但对于 Google Cloud Datastore 是带有“@”的,如下所示:

query_string = ('SELECT * FROM Person WHERE height >= @minHeight '
'AND height <= @maxHeight')
gql_query.query_string = query_string

query_arg = gql_query.name_arg.add()
query_arg.name = 'minHeight'
query_arg.value.integer_value = 48

query_arg = gql_query.name_arg.add()
query_arg.name = 'maxHeight'
query_arg.value.integer_value = 60

抱歉,如果这是一个愚蠢的问题,但我不确定在 Google App Engine 和 Google Cloud Datastore 中是否使用相同 GQL

提前致谢!

最佳答案

您链接到的页面有完整的差异列表: https://developers.google.com/datastore/docs/concepts/gql_reference#unsupported_features_and_behavior_differences_from_mysqlpython_gql(点击标签“Python GQL for App Engine differences”)。

关于python - GQL 是否与用于谷​​歌应用引擎和谷歌云数据存储的语言相同?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19927129/

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