Forums/Other/SQL Yoga

Answered

Protecting my db from writes from users of other dbs in a multiple database setting?

david
asked this on August 10, 2010 06:48

Hi Trevor, I'm getting back to using sqlYoga for the open source handler library we discussed last year, at present the handlers are in text files stored in git, and I want to make these available to users within the IDE. Issues here are that a user may be using their own copy of sqlYoga to develop their own dbs - as indeed I am with my own set up - that is I have the "handler" db, and an application db I am working on.

I've named the handler db "OPN_HkeyDatabase", and been using the db name explicitly in all calls to sqlyoga_xxx. However I am failing miserably to avoid the "OPN_HkeyDatabase" being overwritten by "default" db authoring techniques. One of the reasons is I think to do with the implementation of "default database" in sqlYoga. A non-default db is automatically turned into a default db when it is the only one left and a user closes the default db they were working on.

From then on any script hanging around (and they do :), that the developer has for writing to the default db of their application will clobber "OPN_HkeyDatabase". In short I can see no way of making it even slightly unlikely that a developer working on their own db casually within the IDE will interfere with the handler db? The natural answer is to put the db on the server, but I want an offline solution. Any ideas? Perhaps using valentina and some password protected access? I'm testing with sqlite at the moment.