Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQLite support for complex queries involving multiple tables #56

Open
awicenec opened this issue Feb 15, 2013 · 0 comments
Open

SQLite support for complex queries involving multiple tables #56

awicenec opened this issue Feb 15, 2013 · 0 comments
Milestone

Comments

@awicenec
Copy link

SQLite does not return data types in the description of the result set. Thus the standard solution does not work. In order to support complex, multi-table queries (joins) I have patched sqltable.py in the following way:

128,129c128
< #    if not query or dbtype == 'sqlite':
<     if not query:

---
>     if not query or dbtype == 'sqlite':
157d155
<         results = cursor.fetchall()
160,161d157
<             column_names = map(lambda x:x[0], cursor.description)
<       column_types = map(lambda x:type(x),results[0])
175c171
<         results = cursor.fetchall()

---
>     results = cursor.fetchall()
295a292
> 

With this change complex queries do work correctly also for SQLite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant