Re: writing a simple sql parser and database program

From: "Jonah H(dot) Harris" <jonah(dot)harris(at)gmail(dot)com>
To: "Peter Michaux" <petermichaux(at)gmail(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: writing a simple sql parser and database program
Date: 2006-11-07 12:32:03
Message-ID: 36e682920611070432ke5d17d3m26be8036e6c6d033@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On 11/7/06, Peter Michaux <petermichaux(at)gmail(dot)com> wrote:
> I would like to learn how to write a simple SQL parser and database
> program ... Is there a link or book that explains the basics of how a
> database parses SQL and how it then operates on the data?

For a fairly good learning resource, you can check out LEAP
(http://leap.sourceforge.net/); it doesn't use SQL and instead, has
it's own relational language... but it's a good place to start if you
want to learn how this stuff works. You can also check out pql
(http://www.ibiblio.org/pub/Linux/apps/database/sql/pql-0.8.1.src+bin.tgz),
which uses a SQL-ish language, or SQLite for a little more advanced
example (http://www.sqlite.org)

Of course, there's a lot of fairly simple and easy-to-understand Java
databases like hsql or McKoi too. Most Java databases are going to be
using ANLTR or JavaCC for their parsers while C/C++-based databases
use Bison, ANTLR/PCCTS, or a hand-written SQL parser.

A Java database is going to be a lot easier to understand the concepts
of than one in C.

--
Jonah H. Harris, Software Architect | phone: 732.331.1300
EnterpriseDB Corporation | fax: 732.331.1301
33 Wood Ave S, 2nd Floor | jharris(at)enterprisedb(dot)com
Iselin, New Jersey 08830 | http://www.enterprisedb.com/

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Aaron Bono 2006-11-07 14:40:38 Re: Nested select
Previous Message Peter Michaux 2006-11-07 07:02:09 writing a simple sql parser and database program