A uri of /schema will output a dump of the schema in JSON, a-la:
"SCHEMA": {
"Apartment": {
"square_footage": "MYSQL_TYPE_LONG",
"id": "MYSQL_TYPE_LONG",
"bathrooms": "MYSQL_TYPE_LONG",
"rooms": "MYSQL_TYPE_LONG",
"building_id": "MYSQL_TYPE_LONG"
},
"Membership": {
"community_association_id": "MYSQL_TYPE_LONG",
"tenant_id": "MYSQL_TYPE_LONG"
},
etc...
If the server is started with "-m [mapper lua]", requesting a uri
of /map willl output the json generated by the mapper lua script.
This script has access to the schema JSON object, and can be used to
generate ORM-style relationship mapping. The unit test mapper,
test/map.lua is pretty much the reference example, and currently
outputs json like the following:
{
"MAP": {
"Apartment": {
"table": "Apartment",
"members": {
"tenants": {
"class": "Apartment",
"relation": "many_to_one",
"table": "Tenant",
"key": "apartment_id"
},
"square_footage": "LONG",
"bathrooms": "LONG",
"id": "LONG",
"rooms": "LONG",
"building": {
"class": "Building",
"relation": "many_to_one",
"table": "Apartment",
"key": "building_id"
},
"building_id": "LONG"
},
"key": "id"
},
...
SVN uri for the lua branch:
http://www.dbslayer.org/svn/dbslayer/branches/lua
-- Mike