Re: writing a simple sql parser and database program - Mailing list pgsql-sql

From Jonah H. Harris
Subject Re: writing a simple sql parser and database program
Date
Msg-id 36e682920611070432ke5d17d3m26be8036e6c6d033@mail.gmail.com
Whole thread Raw
In response to writing a simple sql parser and database program  ("Peter Michaux" <petermichaux@gmail.com>)
List pgsql-sql
On 11/7/06, Peter Michaux <petermichaux@gmail.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@enterprisedb.com
Iselin, New Jersey 08830            | http://www.enterprisedb.com/


pgsql-sql by date:

Previous
From: "Peter Michaux"
Date:
Subject: writing a simple sql parser and database program
Next
From: "Aaron Bono"
Date:
Subject: Re: Nested select