EDS and SQL

new topic     » topic index » view thread      » older message » newer message

Has anyone worked on writing a SQL engine for use with EDS?  The only thing
I could see in the archive was Buddy Hylbergs toolbox, which outputs some
SQL code.  I've come up with some general ideas for how it could be done,
but I'd rather build on stuff others have done than redesign the wheel.

Here's my basic idea:

Within an eds file, an extra table is added: TABLEDEF (or something similar)

The key's are the names of the tables, and the data elements contain a
sequence which describes the structure and field names for each table:

Each field would be described using two sequences:
-- The field name
-- The contents

The contents of the field could be described by either an empty sequence, or
by another field name.  This way, we could preserve the flexibility of
deeply nested sequences, while making it easy to use the data.

Example:
Suppose table MAIL contains information about people on a mailing list,
where the records have the structure:

{ { "Name", {
        {"First", {}},
        {"Last", {}},
  },
  { "Address",
        {"Street", {}},
        {"City", {}},
        {"State", {}},
        {"ZIP", {}}
  }
}

Then to refer to a field in a SQL statement (I'm assuming case insensitive):

First Name: "name.first"
Street: "address.street"
Address" "address"
etc.

Using this method, we should be able to grab a single field, or a more
complex, nested sequence of fields.  It's also occurred to me that you could
use the actual indices of the fields (which, of course requires that you
know how they're stored):

First name: "[1][1]"
State: "[2][3]"

or any combination:
Last Name: "name.[2]"
Zip: "[2].zip"

There are lots of ways to implement this scheme, I think.  This seems like a
good way to make SQL Euphoric, and add tons of power to EDS and Eu.

Matt Lewis

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu