Re: testing for table existence
Roger Binns <[email protected]>
| Newsgroups | gmane.comp.python.db.pysqlite.user |
|---|---|
| Message-ID | <[email protected]> |
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Colin Barnette wrote: > I have a function I use which returns a list of the table names via > the sqlite_master table, hope this helps! You can also use the pragmas. http://sqlite.org/pragma.html You can use database_list to get the list of attached databases. table_info is useful for getting the information about each table and provides sufficient information to recreate the table. (Before alter table add column existed you had to use it to create a new table and transfer the columns+values over from the old one). Roger -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFF49MgmOOfHg372QQRAoXPAKDlt5ZaFBxBo+QWOG3qt1NyPZwPPgCfSjGV Tgc8mjtSsyHnB4WGMUPNU0Y= =/IpK -----END PGP SIGNATURE-----