Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Importing Sqlite data into Google App Engine

I have a relatively extensive sqlite database that I'd like to import into my Google App Engine python app.

I've created my models using the appengine API which are close, but not quite identical to the existing schema. I've written an import script to load the data from sqlite and create/save new appengine objects, but the appengine environment blocks me from accessing the sqlite library. This script is only to be run on my local app engine instance, and from there I hope to push the data to google.

Am I approaching this problem the wrong way, or is there a way to import the sqlite library while running in the local instance's environment?

like image 902
Keck Avatar asked May 20 '10 00:05

Keck


People also ask

Does Google Cloud support SQLite?

To setup and install SQLite server on any of the cloud platforms (Azure, AWS, Google GCP), the best way is to use the SQLite server image from the cloud marketplaces.

Can I use SQLite in web application?

SQLite will normally work fine as the database backend to a website. But if the website is write-intensive or is so busy that it requires multiple servers, then consider using an enterprise-class client/server database engine instead of SQLite.

Can App Engine Standard connect to on Prem database?

On premises Because App Engine and Compute Engine use the same networking infrastructure, you can use the VPN connection to establish a connection between the App Engine app and your on-premises database using the database server's internal IP address.


2 Answers

I would make suitable CSV files from the Sqlite data, in a separate script, then use bulk loading to push the data from the CSV files up to app engine.

like image 187
Alex Martelli Avatar answered Oct 03 '22 19:10

Alex Martelli


If you need to access your datastore outside of the App Engine environment (like if you need to use libraries not present in App Engine or do other things App Engine does not support with the datastore) then the best option is the Remote Api.

There is an excellent tutorial on that here: http://code.google.com/appengine/articles/remote_api.html

Essentially you import the remote_api module, authenticate with Google to access your datastore, then run your data access commands (query, update, delete, etc) as you normally would in app engine.

like image 34
RDS Avatar answered Oct 03 '22 20:10

RDS