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


Groups > comp.lang.python > #21709

Re: Pragmas, foreign keys in sqlite3?

From Dennis Lee Bieber <wlfraed@ix.netcom.com>
Subject Re: Pragmas, foreign keys in sqlite3?
Date 2012-03-15 16:21 -0400
Organization > Bestiaria Support Staff <
References <41621d5f-072f-41e5-a880-57d78a298250@j5g2000yqm.googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.699.1331842892.3037.python-list@python.org> (permalink)

Show all headers | 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