Your feedback is appreciated. I am busy working on a release which should be available later today. Your request has now been addressed and is part of the release. Thanks for trying APSW.
Thank you for the kind words. I was especially delighted when noticing that cysqlite also supports table valued functions in Python. I'm hoping they become a standard thing for Python developers using SQLite, because it makes bridging SQLite and Python even more productive.
I originally started out doing exactly what you said - dumping Python dictionaries into a file and reading/writing that. It worked well. Where it really hurt was I wanted to add undo functionality, and that means needing to store the before and after view of the data. And I wanted it more sophisticated than that - be able to view what the data looked like at any point in time.
That forced me to use a database, because now I could use triggers to automatically save off old values, and views to use them nicely.
There were many Python SQLite wrappers at the time, but I didn't like them. So I wrote another one :)
As you found out this happens because the cursor is immediately exhausted as there are no rows, and then is cleaned up and so column data names are not available.
Behind the scenes you can use an execution tracer to extract the information. That is what query_info does. although it aborts execution after recording it.
Thanks for the detailed explanation, I will try with apsw.ext.query_info. In my case I was building column-keyed dicts from results but as the result was an empty set, there was nothing to key on.
Appreciate the pointer to the execution tracer too.
There is even a website that tracks around 150 different Linux and BSD flavours (even termux) and shows package name, version, etc for each it is present on - see https://repology.org/project/python:apsw/versions