Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Gdbm module



On Feb 21, 11:52am, Sebastian Gniazdowski wrote:
}
} [...] who would accept Oracle DBM module into Zsh? 

Depends entirely on the licensing Oracle specifies.

} I looked at [sqlite], to do:
} 
} result=sqlarray["SELECT telephone FROM contacts WHERE id=1"]
} 
} And require single column to be selected, or concatenate columns

I would not suggest attempting to make a full SQL interface from the
tied hash to the database.  GDBM is effectively one table per file
with a single unique key column, so the only thing you can do is
"SELECT * FROM ...".  For a SQL-type database you'd probably want
to do something like

    ztie -d db/sqlite -Q "SELECT ..." ... queryresult

and define queryresult in a manner similar to the way Perl DBI does
with fetchall_hashref.

This theoretical -Q option could be extended to GDBM as a way to
filter the set of keys fetched so the hash does not have to load the
entire dbmfile.  However, at first we might prefer to restrict things
to flatter single-table access.

Also note I'm only trying to offer some guidelines here; I've seen no
evidence that this is needed or more than academically interesting.



Messages sorted by: Reverse Date, Date, Thread, Author