Skip to content
mauritslamers edited this page Sep 13, 2010 · 29 revisions

Welcome to the orion-db wiki!

The orion-db package 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.

If you do not get it working with the instructions in the README and INSTALL files

  • 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 to http://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.

Comments

Clone this wiki locally