[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH][merge-tracking]Create mergeinfo.db with proper schema in case it does not exist.

From: Malcolm Rowe <malcolm-svn-dev_at_farside.org.uk>
Date: 2007-01-02 23:01:05 CET

On Thu, Dec 21, 2006 at 06:27:36PM +0530, Kamesh Jayachandran wrote:
> Create mergeinfo.db with the necessary schema if the db does not exist with
> one.

It's annoying that SQLite doesn't give us any way to tell whether it's
created a blank database for us, but I'd prefer that we use SQLite's
built-in support for user schema version numbers rather than assume that
a SQLITE_ERROR return means that we should create the schema afresh.

That is, after connecting to the database, issue a

  PRAGMA user_version;

command. If it returns zero, create the database schema and then issue

  PRAGME user_version = 1;

to record that we've created the schema.

I'm assuming that we'd tie the mergeinfo schema version to the
repository format number, so we wouldn't actually use the user_version
value as a proper format number, just a created/not-created indicator.


  • application/pgp-signature attachment: stored
Received on Tue Jan 2 23:01:13 2007

This is an archived mail posted to the Subversion Dev mailing list.