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


Groups > comp.lang.python > #21709

Re: Pragmas, foreign keys in sqlite3?

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
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.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'subject:sqlite3': 0.05; 'sqlite': 0.07; 'deletes': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:keys': 0.09; 'python?': 0.15; 'bieber': 0.16; 'declaimed': 0.16; 'dumps': 0.16; 'email addr:ix.netcom.com': 0.16; 'email name:wlfraed': 0.16; 'from:addr:ix.netcom.com': 0.16; 'from:addr:wlfraed': 0.16; 'from:name:dennis lee bieber': 0.16; 'received:wlfraed': 0.16; 'returned,': 0.16; 'sqlite3': 0.16; 'there...': 0.16; 'url:netcom': 0.16; 'url:wlfraed': 0.16; 'wulfraed': 0.16; '>>>': 0.18; 'part,': 0.18; 'url:home': 0.21; "doesn't": 0.22; '(or': 0.22; '-0700': 0.23; 'modification': 0.23; 'command': 0.24; 'changes,': 0.24; 'structure': 0.26; 'tried': 0.27; 'table,': 0.29; 'recreate': 0.30; 'subject:?': 0.31; 'thu,': 0.32; 'implement': 0.32; 'there': 0.33; 'header:X-Complaints-To:1': 0.34; 'lee': 0.34; 'keys': 0.34; 'to:addr:python-list': 0.35; 'data.': 0.36; 'received:org': 0.36; 'charset:us-ascii': 0.37; 'received:76': 0.37; 'some': 0.38; 'data': 0.38; 'data,': 0.39; 'to:addr:python.org': 0.40; "you'll": 0.61; 'foreign': 0.64; 'dennis': 0.73; 'surprise': 0.97
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Dennis Lee Bieber <wlfraed@ix.netcom.com>
Subject Re: Pragmas, foreign keys in sqlite3?
Date Thu, 15 Mar 2012 16:21:26 -0400
Organization > Bestiaria Support Staff <
References <41621d5f-072f-41e5-a880-57d78a298250@j5g2000yqm.googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host adsl-76-253-99-231.dsl.klmzmi.sbcglobal.net
X-Newsreader Forte Agent 3.3/32.846
X-No-Archive YES
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://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 <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.699.1331842892.3037.python-list@python.org> (permalink)
Lines 27
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1331842892 news.xs4all.nl 6963 [2001:888:2000:d::a6]:48277
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:21709

Show key headers only | View raw


On Thu, 15 Mar 2012 09:59:54 -0700 (PDT), llanitedave
<llanitedave@veawb.coop> declaimed the following in
gmane.comp.python.general:

> it, and how to implement or add foreign keys to existing tables.
>
	For the most part, SQLite3 doesn't permit any modification to
existing tables; one basically dumps the data, deletes the table,
redefines it with needed changes, reloads the data.
 
> Is there some way to use the sqlite PRAGMA command from within python?
> 
> I tried connecting to the database and got
> 
> >>> cr.execute('''PRAGMA foreign_keys;''')
> <sqlite3.Cursor object at 0xb7335720>
>
	No surprise there... If any data is returned, you'll need to do a
cr.fetch() (or .fetchall() ).

> Do I need to recreate the entire database structure from scratch?

	As mentioned above... essentially...
-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
        wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

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


Thread

Pragmas, foreign keys in sqlite3? llanitedave <llanitedave@veawb.coop> - 2012-03-15 09:59 -0700
  Re: Pragmas, foreign keys in sqlite3? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-03-15 16:21 -0400

csiph-web