Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #109781

Re: Tie dictionary to database table?

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Peter Otten <__peter__@web.de>
Newsgroups comp.lang.python
Subject Re: Tie dictionary to database table?
Date Fri, 10 Jun 2016 14:25:22 +0200
Organization None
Lines 25
Message-ID <mailman.134.1465561692.2306.python-list@python.org> (permalink)
References <drt5r8Ft1maU1@mid.individual.net> <CAO1D73Hb9_guWHxjer226APrFqTFM3eCWxmW4570Hpt5smvFmQ@mail.gmail.com> <CAGgTfkN6vSY-hSSqmRjxioOYJGDrO6HshNLHJGPtM_tOB8wdFw@mail.gmail.com> <mailman.126.1465512052.2306.python-list@python.org> <drv8l8Fb7nnU1@mid.individual.net> <njdqq7$cr5$1@dont-email.me> <drvkmoFdk2vU3@mid.individual.net> <njebji$ba1$1@ger.gmane.org>
Mime-Version 1.0
Content-Type text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding 7Bit
X-Trace news.uni-berlin.de 2FTLkfm6dJIBzErx3LAaRQrvlAfMOYH01+hOTNIvI8Wg==
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'modified': 0.05; 'concurrent': 0.09; 'orm': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.10; 'dictionary,': 0.16; 'meanwhile': 0.16; 'perl.': 0.16; 'processes.': 0.16; 'received:80.91.229.3': 0.16; 'received:dip0.t-ipconnect.de': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'received:t-ipconnect.de': 0.16; 'recipe': 0.16; 'sqlite3': 0.16; 'wrote:': 0.16; "wouldn't": 0.16; '>>>': 0.20; 'code.': 0.23; 'bit': 0.23; 'header:User-Agent:1': 0.26; 'header:X-Complaints-To:1': 0.26; 'define': 0.27; 'module.': 0.27; 'values': 0.28; 'looks': 0.29; 'url:activestate': 0.29; 'task': 0.30; 'table': 0.32; 'class': 0.33; 'url:python': 0.33; 'michael': 0.33; 'url:code': 0.34; 'but': 0.36; 'url:org': 0.36; 'url:library': 0.36; 'to:addr:python-list': 0.36; 'subject:?': 0.36; 'subject:: ': 0.37; 'received:org': 0.37; 'christian': 0.38; 'does': 0.39; 'rather': 0.39; 'to:addr:python.org': 0.40; 'received:de': 0.40; 'url:3': 0.60; 'your': 0.60; 'skip:u 10': 0.61; 'between': 0.65; 'gollwitzer': 0.84; 'tie': 0.84; 'url:recipes': 0.84
X-Injected-Via-Gmane http://gmane.org/
X-Gmane-NNTP-Posting-Host p57bd95f3.dip0.t-ipconnect.de
User-Agent KNode/4.13.3
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.22
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID <njebji$ba1$1@ger.gmane.org>
X-Mailman-Original-References <drt5r8Ft1maU1@mid.individual.net> <CAO1D73Hb9_guWHxjer226APrFqTFM3eCWxmW4570Hpt5smvFmQ@mail.gmail.com> <CAGgTfkN6vSY-hSSqmRjxioOYJGDrO6HshNLHJGPtM_tOB8wdFw@mail.gmail.com> <mailman.126.1465512052.2306.python-list@python.org> <drv8l8Fb7nnU1@mid.individual.net> <njdqq7$cr5$1@dont-email.me> <drvkmoFdk2vU3@mid.individual.net>
Xref csiph.com comp.lang.python:109781

Show key headers only | View raw


Peter Heitzer wrote:

> Christian Gollwitzer <auriocus@gmx.de> wrote:
>>Am 10.06.16 um 09:30 schrieb Peter Heitzer:
>>> Michael Selik <michael.selik@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.

There's an old recipe for sqlite3

http://code.activestate.com/recipes/576638-draft-for-an-sqlite3-based-dbm/

that you might adapt.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Tie dictionary to database table? "Peter Heitzer" <peter.heitzer@rz.uni-regensburg.de> - 2016-06-09 12:30 +0000
  Re: Tie dictionary to database table? justin walters <walters.justin01@gmail.com> - 2016-06-09 06:09 -0700
  Re: Tie dictionary to database table? Michael Selik <michael.selik@gmail.com> - 2016-06-09 22:40 +0000
    Re: Tie dictionary to database table? "Peter Heitzer" <peter.heitzer@rz.uni-regensburg.de> - 2016-06-10 07:30 +0000
      Re: Tie dictionary to database table? Christian Gollwitzer <auriocus@gmx.de> - 2016-06-10 09:38 +0200
        Re: Tie dictionary to database table? "Peter Heitzer" <peter.heitzer@rz.uni-regensburg.de> - 2016-06-10 10:56 +0000
          Re: Tie dictionary to database table? Peter Otten <__peter__@web.de> - 2016-06-10 14:25 +0200
  Re: Tie dictionary to database table? Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-06-16 20:59 -0700

csiph-web