On Tue, Jan 10, 2017 at 7:52 PM, Simon Slavin <slav...@bigfraud.org> wrote:
> > On 11 Jan 2017, at 3:28am, Kevin O'Gorman <kevinogorm...@gmail.com> wrote: > > > I have a modest amount of data that I'm loading into an SQLite database > for > > the first time. For the moment it contains just two tables and a few > > indices, nothing else. The first table loads okay, and if I stop the > > process at that point, all is well and I can look at the database. > > > > If I go on to the second table, it appears to finish normally, but when I > > try to look at the database with sqlite3, a command-line tool for > > interacting with SQLite, it says the database is corrupt. > > Make absolutely sure you’re starting with a new database file each time, > not continuing to write to an already-corrupt file. > > I'm sure. The program tests for the existence of the main table before starting, and throws an exception if it's there, then creates that table as its first action. > At stages during your Python program, including after you’ve finished > loading the first table, use the following command to check to see whether > the database is correct: > > It's no longer possible. In fixing other things, the program has changed, and it no longer corrupts the database. Thanks for this next thing, though.... > PRAGMA integrity_check > Thanks for that. I was not aware of this tool. I'll keep it handy. > Use the same command in the command-line tool. > > Simon. > -- word of the year: *kakistocracy* _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users