Skip to content

SQLite support for complex queries involving multiple tables #56

Description

@awicenec

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions