RE: Berkeley DB with Euphoria
- Posted by Andy Serpa <renegade at earthling.net> Oct 01, 2002
- 405 views
irv at take.maxleft.com wrote: > > Andy Serpa wrote: > > > Yeah, exactly, so in my example of including database.e twice as "dbA" > > and "dbB" you could: > > > > dbA:db_open("database A") > > dbB:db_open("database B") > > > > Now BOTH databases will be open and current so instead of using > > db_select() and switching back & forth you just use the appropriate > > "dbA:" or "dbB:" in front of the proper one. Sort of a quick & dirty > > way to get separate "instances" in a OOP-like fashion... > > > > (Unless there is some reason that won't work? Like I said, I haven't > > actually tried it.) > > It won't work, because Rob's implementation of namespacing doesn't > create multiple instances of an include, it just makes "aliases" for > one single instance. I, for one, think this is unfortunate. > > Therefore, no matter what you prefix the db_* commands with, they > still use the single copy of database.e with its variables (including > the currently selected database file). > Ok, what if we just make two copies of database.e and then: include databaseA.e as dbA include databaseB.e as dbB Now would they be separate?