Over the past couple of days I got inspired to write a storage system for TiddlyWeb that uses Python's SQLAlchemy[1] library to interact with an RDBMS of your choice[2]. I've run the tiddlyweb test suite against both sqlite3 and mysql by simply changing a line in the tiddlywebconfig.py file.
Things seem to be working correctly, in that the tests are passing and I can run instances using the new store, but I would appreciate some testing and review by other interested folk for at least three reasons: * Bugs are probably lurking. * Writing for SQLAlchemy and RDBMS is not really my thing and I'm sure I've made things more crufty than they really need to be.[3] I decided it was best to make it work, and then make it right later. * The install and use process is probably entirely too obscure, so don't take on this task hoping it will just work without first needing to read the READMEs and such. The code can be found on github in the tiddlyweb-plugins repo: http://github.com/tiddlyweb/tiddlyweb-plugins/tree/master/sqlstore To make it work with few warnings, you will need the very latest TiddlyWeb which has been updated to be a bit more unicode savvy. If you want to use it with an existing instance store, there is a plugin called migrate[4] which can migrate the content of one store to another. I recommend you backup your content before doing this. That plugin is at: http://github.com/tiddlyweb/tiddlyweb-plugins/tree/master/migrate It's expected that this store will become the basis for some kind of "enterprise(y) ready"[5] storage system for TiddlyWeb; more work will be done on it to make it high performance than will be done on the default text store which is designed primarily to be inspected. If you are able to do some work with this and encounter bugs or have suggestions, please post. [1] http://www.sqlalchemy.org/ [2] sqlalchemy has an abstract interface to various python libraries that talk to various database systems. If there is python library support for the database, then it is likely sqlalchemy can talk to it, from the same code. I've tested with sqlite3 and mysql, as that's what I have access to. [3] My main concern is that to get things initially working I mapped TiddlyWeb objects to new objects in the storage module, which are then mapped by SQLAlchemy into the database. This could probably be shortened to just one mapping, but this may have an adverse impact on the TiddlyWeb objects (as demonstarted by the need to reestablish the 'roles' set on the User object in user_get). [4] I'm quite proud of this very simple plugin. It demonstrates nicely why the storage interface system on TiddlyWeb is a good thing. [5] Whatever that means. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/TiddlyWikiDev?hl=en -~----------~----~----~----~------~----~------~--~---
