PRAGMA real_column_names=0|1
Usage: For a given SELECT clause, enabling this pragma causes the column names generated in the resultset (provided they are of TK_COLUMN type) to be returned in dotted form as either TableName.ColumnName or Database.TableName.ColumnName in the case of an attached database. Any alias names are ignored unless they are for an unbound or calculated column in the resultset.
Reason: Enabling this pragma will give database driver implementers (like me) the ability to extract better and more robust schema information gleaned from an arbitrary SELECT clause.
This solution sounds like a cludge to me, that would only work with some select statements. I would prefer a solution that works with all select statements of arbitrary complexity.
That said, the beauty of your "80% solution", aside from having a small code footprint, is that it seems to have no effect on anyone who doesn't reference your pragma.
-- Darren Duncan