piskvorky / sqlitedict

Persistent dict, backed by sqlite3 and pickle, multithread-safe.
Apache License 2.0
1.17k stars 131 forks source link

To create value as non-blob type #88

Closed occoder closed 5 years ago

occoder commented 6 years ago

Hi, I notice that all the values created and entered into sqlite file are of type BLOB. MAKE_TABLE = 'CREATE TABLE IF NOT EXISTS "%s" (key TEXT PRIMARY KEY, value BLOB)' % self.tablename When I need to use a GUI tool like https://github.com/sqlitebrowser/sqlitebrowser to check and adjust the table content, the value can not be shown appropriately. If possible, how to customize the vaule type? Thanks.

occoder commented 6 years ago

It seems following scheme allows me to do that. mydict = SqliteDict('./my_db.sqlite', encode=json.dumps, decode=json.loads)

menshikh-iv commented 5 years ago

@occoder as I see, you resolve your problem, so, I close that.