You are not logged in.
In my MySQL-driven node.js apps, I regularly use JOINs and FKs. I get tired of writing out the same long-winded SQL all the time, and manually initialising databases, so I wrote a wrapper which allows the database to be described by JSON, and to be initialised from JSON.
Foreign-key values are looked-up automatically on load/save/delete (although multiple SELECT queries currently do this; JOINs are on the TODO list).
The package is on npm at mysql-orm and also on github: https://github.com/battlesnake/node-mysql-orm
Example code is available in the README, and in the tests. The example code is somewhat longer than needed to get the point across, but I wanted to avoid "minimalist" documentation as it annoys me when try to learn other frameworks from a 3-line demo.
It is fresh off the barbeque, so probably has reliability issues and certainly has performance issues. If anyone finds it useful, finds bugs, or is infuriated by some missing feature, please let me know here and on the github issue tracker!
Last edited by windows_me (2014-06-10 13:09:29)
[10:04:21] Time for weekly full server backup.
[10:04:25] Redirecting it to "/dev/null" to make it go faster.
[10:04:53] Backup done! Amazing how fast modern technology is!
Offline