Importing Datastore entities into Eclipse emulator

309 views Asked by At

I am trying to run a Google App Engine Java application locally. I have installed the Cloud Tools for Eclipse and configured my project and the project starts OK.

I also see the Datastore Admin.

However, I don't see how I can import Datastore entities into Datastore Admin in Eclipse. I tried to follow the same instructions as for importing the entities into local emulator, however the import does not happen.

I can run the emulator using gcloud and import data there, however my app running in Eclipse does not seem to work with that emulator.

So two questions:

  1. Can I configure Eclipse to use the gcloud Datastore emulator instead of running one separately?

  2. Can I import Datastore entities into Eclipse run emulator?

1

There are 1 answers

6
Daniel Ocando On
  1. Cloud Tools for Eclipse doesn't include an explicit separate emulator. In order to use the Datastore Emulator please refer to the following section of the documentaiton in order to understand how to run it and this section to understand how to export and import emulator data. Notice that you just basically need to send an HTTP request (more specifically a POST request in the case of importing entities) with either a curl or a similar command.

  2. To interact with the Datastore instance (import entities, export entities, etc.) in a local server you can either use the Cloud Client Libraries for Java or third-party libraries like Objectify. Follow this section of the documentation to configure Eclipse to use the Cloud Client Libraries in a Local Server. And an example of how to use it here Follow this part of the documentation in order to configure Objectify when running applications locally, and all the relevant examples on how to load, save and delete data here.