google-cloud-datastore

Google Cloud Functions Environment Variables

↘锁芯ラ 提交于 2019-12-18 12:22:02
问题 Is it possible to set environment variables for GCF so that all that settings would be visible to all functions? Or maybe there are some options to configure it in project's scope? I'm just need a mechanism to parametrize all environments, like local-dev, dev, stage, prod for functions. For now I'm trying setup local datastore emulator and setup local development/debugging/testing workflow without writing if statements inside code. As I found such things can be configured through env.

What is the python for Java's BigDecimal?

烂漫一生 提交于 2019-12-18 11:50:30
问题 In Java, when we program money it is recommended to use the class BigDecimal for money. Is there something similar in python? I would like something object-oriented that can have a currency and an exchange rate, has that been done? I store money as integers of cents (I think) and multiply with 100 to get dollars but I also have foreign currency so listing listing ordered by price becomes inconvenient when articles have different currencies and even are listed as price per hour or per item. So

GAE Datastore backup

十年热恋 提交于 2019-12-18 11:35:35
问题 This question was migrated from Server Fault because it can be answered on Stack Overflow. Migrated 10 years ago . Is it necessary to do backups of GAE's Datastore? Does anyone have any experience, suggestions, tricks for doing so? 回答1: You can now use the managed export and import feature, which can be accessed through gcloud or the Datastore Admin API: Exporting and Importing Entities Scheduling an Export 回答2: Backups are always necessary to protect against human error. Since App Engine

How many Datastore reads consume each Fetch, Count and Query operations?

我与影子孤独终老i 提交于 2019-12-18 11:08:27
问题 I'm reading on Google App Engine groups many users (Fig1, Fig2, Fig3) that can't figure out where the high number of Datastore reads in their billing reports come from. As you might know, Datastore reads are capped to 50K operations/day, above this budget you have to pay. 50K operations sounds like a lot of resources, but unluckily, it seems that each operation (Query, Entity fetch, Count..), hides several Datastore reads. Is it possible to know via API or some other approach, how many

GAE - How to live with no joins?

匆匆过客 提交于 2019-12-18 10:22:48
问题 Example Problem: Entities: User contains name and a list of friends (User references) Blog Post contains title, content, date and Writer (User) Requirement: I want a page that displays the title and a link to the blog of the last 10 posts by a user's friend. I would also like the ability to keep paging back through older entries. SQL Solution: So in sql land it would be something like: select * from blog_post where user_id in (select friend_id from user_friend where user_id = :userId) order

Google Web Toolkit (GWT) + Google App Engine (GAE) + Detached Data Persistence

五迷三道 提交于 2019-12-18 10:16:24
问题 I would like to develop a web-app requiring data persistence using GWT and GAE. As I understand it, my only (or at least by far the most convenient) option for data persistence is GAE's Datastore, using JDO or JPA annotated objects. I would also like to be able to send my objects back and forth client-server using GWT Remote Procedure Calls (RPC), therefore my objects must be able to "detach". However, GWT RPC serialization cannot handle detached JDO/JPA objects and it doesn't appear as

Google cloud datastore API cannot find project when App Engine application is disabled

元气小坏坏 提交于 2019-12-18 09:34:21
问题 I'm trying to connect and get data from Google Cloud Datastore API. After disabling my App Engine Application (which have no use for me at the moment), I cannot access any GC Datastore API methods. When I send my request, I always get the following response: { [Error: The project [my-project] does not exist.] code: 404, metadata: Metadata { _internal_repr: {} } } I've already double-checked this and my project name is correct. Accessing the google cloud console, I noticed that the datastore

Where is my local App Engine datastore?

廉价感情. 提交于 2019-12-18 03:31:26
问题 How can I find where my local development datastore is located? I am using the Python SDK and Linux . 回答1: I think it depends on if you got Java or Python SDK. For Python, here's what the instructions say from Google: "The web server prints the location of the datastore file it is using to the terminal when it starts up. You can make a copy of the file, then restore them later to reset the datastore to a known state. Be sure to restart the web server after replacing the datastore file. To

How to filter a GAE query?

巧了我就是萌 提交于 2019-12-17 20:38:27
问题 I'm trying to save two records and then get the 2nd one. The issue is that the filter doesn't seem to work. Although I filter by Name ("Andrew W") I always get "Joe Citizen". The counter also indicates 2 records when it should be just one. This drives me crazy. See the full code below. The result prints counter 2 e2 {"Joe Citizen" "Manager" "2015-03-24 09:08:58.363929 +0000 UTC" ""} package main import ( "fmt" "time" "net/http" "google.golang.org/appengine" "google.golang.org/appengine

How to build datastore indexes (PHP GAE)

守給你的承諾、 提交于 2019-12-17 19:56:15
问题 I am using Tom Walder's Google Datastore Library for PHP to insert data into my Google App Engine Datastore. $obj_schema = (new GDS\Schema('Add Log')) ->addString('name', TRUE) ->addDatetime('time', TRUE); $obj_store = new GDS\Store($obj_gateway, $obj_schema); $obj_store->upsert($obj_store->createEntity(['name' => "test",'time' => date('Y-m-d H:i:s', time())])); When I insert data like the above code, everything seems to be importing properly (each property say they are indexed). But when I