My favorites | Sign in
Project Home Downloads Wiki
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions

Issue 43 attachment: test-mysql.py (516 bytes)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import pyodbc

CONN_STR_TMPL = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=%(host)s;PORT=%(port)s;DATABASE=%(db)s;UID=%(user)s;PWD=%(passwd)s;Option=3;"

params = {
'host':'127.0.0.1',
'port':'3306',
'db':'test',
'user': 'root',
'passwd':'root'}
conn = pyodbc.connect(CONN_STR_TMPL % params)

for row in conn.cursor().foreignKeys("test1", params['db'], ""):
print 'fk ' + str(row)

for row in conn.cursor().tables("test1", params['db'], "", 'TABLE'):
print 'table ' + str(row)
Powered by Google Project Hosting