Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can use Google App Engine with MS-SQL

I use

  • python 2.7
  • pyodbc module
  • google app engine 1.7.1

I can use pydobc with python but the Google App Engine can't load the module. I get a no module named pydobc error.

How can I fix this error or how can use MS-SQL database with my local Google App Engine.

like image 286
user1622511 Avatar asked Apr 19 '26 08:04

user1622511


1 Answers

The Google App Engine does not support access to your own SQL server, and does not support loading C-API libraries of your own.

You can use the Google Cloud SQL storage, which is implemented with MySQL databases, which you can access via their Cloud SQL API for Python.

Note that the rdbms module Google provides implements the PEP 249 Python database API 2.0 specification, just like the pyodbc module, so you should have no problems using it:

from google.appengine.api import rdbms

conn = rdbms.connect(instance=INSTANCE_NAME, database=DATABASE)
cursor = conn.cursor()
cursor.execute('SELECT * FROM sometable')
like image 172
Martijn Pieters Avatar answered Apr 21 '26 21:04

Martijn Pieters