===== open-ils.cstore interface ====
All methods are prefixed with //open-ils.cstore//. Parameters are in **bold**. Examples for srfsh are in ''code'' blocks.
=== transaction.begin ===
* returns new transaction ID on success, execption on failure
request open-ils.cstore open-ils.cstore.transaction.begin
=== transaction.{commit|rollback} ===
* completes a transaction block
* returns transaction ID on success, execption on failure
request open-ils.cstore open-ils.cstore.transaction.commit "trans-id-foo-1"
request open-ils.cstore open-ils.cstore.transaction.rollback "trans-id-foo-1"
=== savepoint.set ===
* **new savepoint name** -- existing savepoints are moved forward
* returns new savepoint name on success, exception on failure
request open-ils.cstore open-ils.cstore.savepoint.set "sp-id-foo-1"
=== savepoint.{release|rollback} ===
* **savepoint name**
* returns savepoint name on success, exception on failure
request open-ils.cstore open-ils.cstore.savepoint.release "sp-id-foo-1"
request open-ils.cstore open-ils.cstore.savepoint.rollback "sp-id-foo-1"
=== direct.{object}.retrieve ===
* **pkey value**
* **select/flesh blob**
* "flesh" : depth -- link depth to follow when filling in fkeys
* "flesh_fields" : { "table id" : [field list], ... } -- limit fkeys to those matching one of [ field list ]
* "select" : { "table id" : [ real field list ] -- fields to retrieve (pkey is usually required for fleshing fkeys)
request open-ils.cstore open-ils.cstore.direct.biblio.record_entry.retrieve 1, {"flesh" : 2, "flesh_fields" : {"bre":["call_numbers"],"acn":["copies"]}}
=== direct.{object}.search[.atomic] ===
* **abstract search style blob** -- { "col" : "val", "col2" : [x,y,z], "col3" : { ">=" : "bar" } }
* **select/flesh/order blob** -- Same options as //.retrieve//, with the addition of:
* "order_by" : "sorting clause" -- simple ORDER BY clause for core object type
* "limit" : maximum number of objects to retrieve, for paging
* "offset" : skip this many objects, for paging
request open-ils.cstore open-ils.cstore.direct.biblio.record_entry.search {"creator" : 1, "create_date" : { "between" : ["2006-06-01","2006-07-01"] } }, {"flesh" : 2, "flesh_fields" : {"bre":["call_numbers"],"acn":["copies"]}}
//Stream all values in the table, sorted by description field//
request open-ils.cstore open-ils.cstore.direct.config.i18n_locale.search {"code": {"!=":null}}, {"order_by": {"i18n_l" : "description"}}
=== direct.{object}.id_list[.atomic] ===
* same as .search, but returns a stream (or an array, for **.atomic**) of object pkey values
=== direct.{object}.create ===
* **new object**
* returns new object as represented in DB
request open-ils.cstore open-ils.cstore.direct.actor.workstation.create { "__c" : "aws", "__p" : [1,null,null,null,"Mike's workstation",18] }
=== direct.{object}.update ===
* **modified object**
* returns object ID on success, NULL on failure
request open-ils.cstore open-ils.cstore.direct.actor.workstation.create { "__c" : "aws", "__p" : [null,1,null,47,"Bill's workstation",18] }
=== direct.{object}.delete ===
* **object or pkey value for deletion**
* returns old object ID on success, NULL on failure
request open-ils.cstore open-ils.cstore.direct.actor.workstation.delete 47