-
Notifications
You must be signed in to change notification settings - Fork 2
Home
mauritslamers edited this page Sep 13, 2010
·
29 revisions
OrionDB is a generic DB front end in PHP for use with the SC.RestServer server communication object in Sproutcore.
It allows you to create a model system in a MySQL database and use the same model system in Sproutcore and get direct access to it.
A few notices:
- OrionDB doesn’t have a permission system yet.
OrionDB is released under the very liberal MIT license.
- Generic access to the database using the table names as models. Just create the database and your SC models.
- You can configure OrionDB to only allow connections from Sproutcore applications.
- Sessions and support for a "SC login client" with automatic forwarding
- permission system
- Check whether the server in your application or framework has the postFormat property set to SC.JSON_FORMAT. This is set in the core.js of your application or framework and the line should look like this:
server: SC.RestServer.create({ prefix: ['appName'], postFormat: SC.JSON_FORMAT }),
where appName is the name of your application or framework
- Check whether the names in the request match the names of the tables exactly. OrionDB expects the names of your models to be exactly (case-sensitive!) the same in both MySQL and Sproutcore. This is because OrionDB will search for the table with the same name as is requested and generate the necessary information directly from the table data in the database. So check whether the name in the resourceURL, the model name and the table name in MySQL are the same.
So, a resourceURL'tablename'
in your Sproutcore model will result in a request tohttp://host/path/to/resource/tablename'
and this will return the contents of that table in a JSON encoded string containing a property called type with the name of the table in it.
- OrionDB expects the .htaccess file to forward the actual request to index.php. If the Apache configuration does not allow the use of .htaccess files to extend the server configuration, contact the system administrator.
- If you think you have found a bug in the system, please file a ticket at http://oriondb.lighthouseapp.com and if you can, provide a patch or code that fixes the problem.
- If you encounter issues, please go to the Sproutcore IRC channel on freenode: #sproutcore and ask for help there.