Store - a simplistic data store over TDBC (25Jan2011 CMcC)
Latest version can always be found here [L1 ] and was developerd as a Wub utility.
A 'store' is considered to be a database with fairly simple access/update requirements:
Store presumes we're primarily interested in one table of a db, and that all tables can meaningfully be accessed by row number / oid.
Store LRU-caches tdbc-prepared statements for all DB interactions this saves time re-preparing statements which might not change
Store provides get/set/incr for individual fields by record oid
Store provides for record matching/fetching/updating/deleting using a match alist, passed in args, whose terms are ANDed together.
Match alists comprise pairs of words, similar to a dict, but with repetition permitted. The name part of each pair may be a simple field name, in which case it represents a match for equality with the named field.
If the name part of a match alist is suffixed with **, * or %, it will be treated as a REGEXP, GLOB or LIKE field comparison, respectively.
If the name part of a match alist is suffixed with ?, then it will be interpreted as "IS NOT NULL" or "IS NULL" depending on the truth value of its associated value, so fred? 0 will succceed if the field fred is null.
The name part may also be suffixed with >=, <=, >, <, != or = to indicate the respective SQL comparison operator.
Despite its focus on simple matches and single table access, Store exports [db], [stmt] and [stmtL], providing unfettered access to the underlying database. The stmt commands provide caching.