Postgres Object Relational Map System
Switch branches/tags
Nothing to show
Pull request Compare This branch is 1 commit behind shackbarth:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

#Postgres Object Relational Map System

This repository contains the database object definitions for an embedded ORM system running through the PLV8 javascript engine.



Build and install PostgreSQL from source.

Optional: If you want to use data encryption, in the contrib/crypto directory sudo make install.

Build the v8 library then copy the libv8* shared libraries to /usr/local/lib.

Build the plv8js PostgreSQL extension via make; sudo make install (make sure to check instructions).

Add the following to the bottom of the postgresq.conf file: custom_variable_classes = 'plv8'


In order to use any of the functionality provided by this project you must run the following sql statement: select xt.js_init();

The main purpose of this project is to provide an Object Relational Map (ORM) structure and APIs to retreive and manipulate records as json objects, and to make function calls on the database. Some examples are provided below. More may be found in the source files.

##Retrieve a Record

select xt.retrieve_record('{
  "id": 1,
  "prettyPrint": true

##Commit a Record

  select xt.commit_record(
        "notes":"A famous person",
          "type": "UserAccount",
      "address": null,
         "created":"2011-12-21 12:47:12.756437-05",
         "type": "ContactComment",
        "created":"2011-12-21 12:47:12.756437-05",
        "text":"Now is the time for all good men...",
        "type": "ContactComment",
     "type": "Contact",

##Fetch Multiple Records

  select xt.fetch($${ "query":{
                       "attribute": "number",
                       "operator": "BEGINS_WITH",
                       "value": "B"
                     "prettyPrint": true

##Dispatch a function

  select xt.dispatch($${"requestType":"dispatch",