Pyserial and pysqlite data types, need advice

jon vs. python jonvspython at gmail.com
Tue May 18 03:31:51 EDT 2010


The best thing I've found is this:

http://eli.thegreenplace.net/2009/05/29/storing-blobs-in-a-sqlite-db-with-pythonpysqlite/

On Mon, May 17, 2010 at 5:05 PM, jon vs. python <jonvspython at gmail.com>wrote:

> Hi,
> I'm trying to store frames received via serial port (using Pyserial) into a
> sqlite database (using Pysqlite) in order to perform off-line processing.
> Thus I could use both SQL's power and Python's magic to make everything
> easier. I'd like my code to be generic and work both for binary and ascii
> protocols, too.
>
> Which kind of data should I use to store the frames?
> Should I store every byte as a char in VARCHAR? (This seems to fail when
> trying to store non printable characters).
> Should I encapsulate frames in buffer objects and store them in BLOBs?
> (This seems to work but hides content and thus doesn't allow to use database
> operations directly on the data)
> I've also tried, unsuccessfully, to use bytearrays with pysqlite...
>
> Any suggestion?
>
> Thanks, Jon.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20100518/02fae769/attachment-0001.html>


More information about the Python-list mailing list