User Tools

Site Tools


backend-devel:open-ils_cstore_api

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
backend-devel:open-ils_cstore_api [2006/06/16 17:33] – external edit 127.0.0.1backend-devel:open-ils_cstore_api [2022/02/10 13:34] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +===== 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
 +
 +<code>request open-ils.cstore open-ils.cstore.transaction.begin</code>
 +
 +=== transaction.{commit|rollback} ===
 +  * completes a transaction block
 +  * returns transaction ID on success, execption on failure
 +
 +<code>request open-ils.cstore open-ils.cstore.transaction.commit "trans-id-foo-1"</code>
 +
 +<code>request open-ils.cstore open-ils.cstore.transaction.rollback "trans-id-foo-1"</code>
 +
 +=== savepoint.set ===
 +  * **new savepoint name** -- existing savepoints are moved forward
 +  * returns new savepoint name on success, exception on failure
 +
 +<code>request open-ils.cstore open-ils.cstore.savepoint.set "sp-id-foo-1"</code>
 +
 +=== savepoint.{release|rollback} ===
 +  * **savepoint name**
 +  * returns savepoint name on success, exception on failure
 +
 +<code>request open-ils.cstore open-ils.cstore.savepoint.release "sp-id-foo-1"</code>
 +
 +<code>request open-ils.cstore open-ils.cstore.savepoint.rollback "sp-id-foo-1"</code>
 +
 +=== 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)
 +
 +<code>request open-ils.cstore open-ils.cstore.direct.biblio.record_entry.retrieve 1, {"flesh" : 2, "flesh_fields" : {"bre":["call_numbers"],"acn":["copies"]}}</code>
 +
 +=== 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
 +
 +<code>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"]}}</code>
 +
 +//Stream all values in the table, sorted by description field//
 +
 +<code>request open-ils.cstore open-ils.cstore.direct.config.i18n_locale.search  {"code": {"!=":null}}, {"order_by": {"i18n_l" : "description"}}</code>
 +
 +=== 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  
 +
 +<code>request open-ils.cstore open-ils.cstore.direct.actor.workstation.create { "__c" : "aws", "__p" : [1,null,null,null,"Mike's workstation",18] }</code>
 +
 +=== direct.{object}.update ===
 +  * **modified object**
 +  * returns object ID on success, NULL on failure
 +
 +<code>request open-ils.cstore open-ils.cstore.direct.actor.workstation.create { "__c" : "aws", "__p" : [null,1,null,47,"Bill's workstation",18] }</code>
 +
 +=== direct.{object}.delete ===
 +  * **object or pkey value for deletion**
 +  * returns old object ID on success, NULL on failure
 +
 +<code>request open-ils.cstore open-ils.cstore.direct.actor.workstation.delete 47</code>
  

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki

© 2008-2022 GPLS and others. Evergreen is open source software, freely licensed under GNU GPLv2 or later.
The Evergreen Project is a U.S. 501(c)3 non-profit organization.