Tie dictionary to database table?

Peter Heitzer peter.heitzer at rz.uni-regensburg.de
Fri Jun 10 06:56:24 EDT 2016


Christian Gollwitzer <auriocus at gmx.de> wrote:
>Am 10.06.16 um 09:30 schrieb Peter Heitzer:
>> Michael Selik <michael.selik at gmail.com> wrote:
>>> An ORM might be overkill. If you just want a persistent dictionary, just
>>> use the shelve module. https://docs.python.org/3/library/shelve.html
>> That looks like tie in Perl. Unfortunately I have to use mysql as database
>> and I need concurrent read/write as the table may be modified by other
>> processes.
>> Meanwhile I have analized my demans a bit and modified the task so that I
>> need not read values but rather make updates to the tables.

>It wouldn't be that difficult to roll your own thing which does that; 
>you just need to define __setitem__ and __getitem__ in your class which 
>translates between the SQL call and the Python code.
That's a good idea. 



-- 
Dipl.-Inform(FH) Peter Heitzer, peter.heitzer at rz.uni-regensburg.de



More information about the Python-list mailing list