Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: The Book Problem, Open Book Format proposal, Request for comments.

Author: Dann Corbit

Date: 18:49:03 03/03/06

Go up one level in this thread


On March 03, 2006 at 21:40:54, Mark Boylan wrote:

>On March 03, 2006 at 21:12:20, Dann Corbit wrote:
>
>>
>>SQL is language independent.  You can use whatever database engine you like.
>>
>>Some possibilities for the SQL geeky:
>>DB/2 (not sure if there is a free version or not)
>>SQL*Server (there is a free limited version)
>>Oracle (there is a free 2GB limited version)
>>PostgreSQL (free)
>>Firebird (free)
>>
>>Some possibilities for a canned version (come in C form and compile anywhere):
>>SQLite (free, public domain license):
>>http://www.sqlite.org/
>>
>>For the 'object' crowd:
>>FastDB (free, berkeley license):
>>http://www.garret.ru/~knizhnik/fastdb.html
>>
>>It does not have to be a relational database.  Foxpro or the like would work via
>>standards based connections like ODBC or OLEDB or .NET provider.
>>
>>There are lots of other database systems as well.
>>
>>I would use ODBC or JDBC or OLEDB or some other standards based connection.  If
>>you do that, then the database literally does not matter.
>>
>>It would be easy to choose some stock format (like SQLite) and make a canned
>>version that you just bolt on and use.
>
>
>Dann,
>
>I understand that SQL is language independent. But I don't understand the
>logistics. A chess engine is usually just a small single executable file that
>you can download and run. I'm trying to imagine myself as a first time chess
>engine user, downloading Fruit 4.0 (just an example) and having to install
>PostgreSQL! (just another example)

It takes about 30 seconds to install Postgresql if your're fast and 5 minutes if
you are slow.  You could bolt a SQLite engine onto your program and distribute
that with your program.  If you already *have* a SQL platform set up, then you
could use that.  If you want to use a canned version, you could use MS-Access or
SQLite or FastDB or whatever.  It would come bundled with your application.

Here is the PostgreSQL MSI installer:
http://www.postgresql.org/ftp/binary/v8.1.3/win32/

>Maybe it wouldn't be so bad installing PostgreSQL for Arena or the Shredder
>interface, but would every engine have to have a big installer that checked for
>a database installation?

No.  An embedded DB (like FoxPro or SQLite) would be fine.

>The next question would be, how do you share books? If I wanted to create a book
>for my engine (that's a laugh) or just email a book to you, what would be the
>format? Maybe just a bunch of insert statements?

Sure.  Or if you have the same database format, a dump and load.  Or an
Insert/Select over the network (it's not as hard as it sounds).

>insert into position (fen, eval) values
>("rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1", 0);
>
>And I realize that there are APIs to talk to databases, (that's what I was
>suggesting when I said I wouldn't want to include the psql headers and link to
>their libs) but it doesn't answer the question about chess engines being
>responsible for checking the proper installation of a database server.
>
>The only other SQL solution that I could think of is an embedded SQL database.
>Embedded databases sidestep all of the problems with true database servers (like
>Oracle, SQLServer & PostgreSQL) for single user systems. But embedded databases
>generally only work from within a single implementation language. Lots of them
>exist for Java. HSQLDB, Cloudscape, Derby, Daffodil... But off the top of my
>head I can't think of a single embedded C or C++ SQL database.

1.  SQLite (uses a subset of the PostgreSQL grammar and is very impressive for
its small size)
2.  FastDB (memory based and quite fast)

Both of those are ported to dozens of platforms (Windows and Linux included, of
course).

>So, assuming that your engine is in C, what do you do? Write a complex
>installation program that installs MySQL server on the user's machine?

No.  It would have a standard ODBC or OLEDB connection interface, so that the
backend engine did not matter.  By default, I would install a canned SQLite
version, but if they wanted to use Oracle then all they would have to do is run
my SQL script on their Oracle database and point to that as the DSN.  The
marvels of standards based APIs one again shine brightly.



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.