Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'value,': 0.04; 'argument': 0.05; 'method.': 0.07; 'referring': 0.07; "subject:' ": 0.07; 'lawrence': 0.09; 'parameter': 0.09; '(other': 0.16; '-tkc': 0.16; 'from:addr:python.list': 0.16; 'from:addr:tim.thechases.com': 0.16; 'from:name:tim chase': 0.16; 'placeholder': 0.16; 'sqlite': 0.16; 'subject:dates': 0.16; 'subject:sqlite3': 0.16; 'tuple': 0.16; 'url:sqlite': 0.16; 'wrote:': 0.18; '>>>': 0.22; 'code,': 0.22; 'second': 0.26; 'values': 0.27; 'header:In-Reply-To:1': 0.27; 'tim': 0.29; '>>>>': 0.31; 'chase': 0.31; 'url:python': 0.33; 'subject: (': 0.35; 'url:org': 0.36; 'should': 0.36; 'received:10': 0.37; 'depends': 0.38; 'ends': 0.38; 'mine': 0.38; 'url:library': 0.38; 'to:addr:python-list': 0.38; 'fact': 0.38; 'to:addr:python.org': 0.39; 'url:3': 0.61; 'back': 0.62; 'such': 0.63; 'provide': 0.64; 'different': 0.65; 'wish': 0.70; 'miss': 0.74; 'misses': 0.84 X-Sender-Id: wwwh|x-authuser|tim@thechases.com X-Sender-Id: wwwh|x-authuser|tim@thechases.com X-MC-Relay: Neutral X-MailChannels-SenderId: wwwh|x-authuser|tim@thechases.com X-MailChannels-Auth-Id: wwwh X-MC-Loop-Signature: 1424361737365:987501876 X-MC-Ingress-Time: 1424361737365 Date: Thu, 19 Feb 2015 10:03:54 -0600 From: Tim Chase To: python-list@python.org Subject: Re: 'Lite' Databases (Re: sqlite3 and dates) In-Reply-To: References: <4154cc37-0bb0-4bf2-a52c-b728c737357c@googlegroups.com> <54E517B4.4000409@stoneleaf.us> <20150219081758.3dbe83ca@bigbox.christie.dr> X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.10; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-AuthUser: tim@thechases.com X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 30 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1424362832 news.xs4all.nl 2921 [2001:888:2000:d::a6]:37803 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:85913 On 2015-02-19 15:04, Mark Lawrence wrote: > On 19/02/2015 14:17, Tim Chase wrote: >>>> Parameterized queries is just a pet peeve of mine that I wish to >>>> include here. SQLite misses it and I miss the fact SQLite misses >>>> it. The less SQL one needs to write in their code, the happier >>>> one should be. >>> >>> Instead, use the DB-API=E2=80=99s parameter substitution. Put ? as a >>> placeholder wherever you want to use a value, and then provide a >>> tuple of values as the second argument to the cursor=E2=80=99s execute() >>> method. (Other database modules may use a different placeholder, >>> such as %s or :1.) For example:..." >> >> I think Mario was referring to what other back ends call prepared >> statements. >=20 > Is this=20 > https://docs.python.org/3/library/sqlite3.html#sqlite3.Cursor.executemany > an equivalent? Depends on whether sqlite3.Cursor.executemany() uses https://www.sqlite.org/c3ref/stmt.html under the hood. -tkc