bug-gnubg
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gnubg] Database interface


From: Jon Kinsey
Subject: Re: [Bug-gnubg] Database interface
Date: Tue, 25 May 2004 15:26:44 +0100
User-agent: Mozilla Thunderbird 0.6 (Windows/20040502)

Joern Thyssen wrote:

On Tue, May 25, 2004 at 01:12:56PM +0100, Jon Kinsey wrote

I've just had a quick look at the new sql database code and have
managed to get it working under windows.  I've used the public domain
database engine sqlite, which implements a subset of SQL92.  The main
thing used that wasn't covered was schemas, so I've changed my code
here to not use "gnubg." in places.

Maybe we should introduce a variable
schema = "gnubg."
and use it throughout database.py.

Or we could just remove it, is it helpful - after all I guess everything in the database is under the same schema?

I'm not sure about using python to access the database.  It wasn't a
problem as there is a pysqlite module, I just don't think it's
necessary.  To put it another way, it adds a dependency that isn't
strictly required.  I imagine the code could easily be changed so that
the database access is in the C layer and the python code changed to
use this.  Is there any other reason to use python for this?

Python has a documented DB API, so the changes should be relatively
small from database to database. It's almost trivial to add support for
a new database, in the sense that it doesn't require changes to the C
code (e.g., new builds). The current code support all databases which
has a Python DB API v2 just by doing simple changes to the python code.

You're right, in that I've hardly changed database.py to use a different database. I'm not sure how many users are likely to do this though!

Perhaps this gets to the point I was trying to make - how do we see this being used? I doubt many users are database experts, this is what I think is more likely:

Ordinary user:
* Minimal initial configuration of a database
* Use gnubg to store matches in database and retrieve basic statistics
* Possibly use python to run (supplied) scripts to gather other data from database

Power user:
* Use python to write scripts to gather more specialized data from database
* Possibly query database directly

For windows users (who invariable won't have a database on their machine), I would imagine supplying sqlite and not even telling them that it's there would be the best policy.
They then wouldn't necessarily have to install python.

Jon





reply via email to

[Prev in Thread] Current Thread [Next in Thread]