Version 27 by zumbrunn on 06. October 2009, 15:21
| 30 | var book books = Book.query().equals("title", req.params.title).select(); |
Version 26 by zumbrunn on 06. October 2009, 15:18
- Set useMarkdown to
| 13 | The current Git snapshot implements preliminary query functionality for the googlestore, berkeleystore, filestore, memstore backends. Note that while googlestore and berkeleystore use indxing and query functionality provided by the underlying libraries and APIs, filestore and memstore use unindexed, brute force query implementations that require a full read of the queried objects. Berkeleystore |
| 28 | |
| 29 | Query example: |
| 30 | var book = Book.query().equals("title", req.params.title).select(); |
Version 25 by hannes on 04. September 2009, 17:47
| 76 | * save(props, entitiy, tx) entitiy) - save object to db |
| 77 | * remove(key, tx) remove(key) - remove object from db |
Version 24 by hannes on 01. September 2009, 18:05
| 47 | |
| 48 | === Store interface |
| 49 | |
| 50 | A persistent class is created by calling the Storable.defineClass() method with a store implementation and a class name. |
| 51 | |
| 52 | // define Storable base class |
| 53 | defineClass(org.helma.wrappers.Storable); |
| 54 | // create a new store |
| 55 | var store = new MyStore('/db'); |
| 56 | // create a persistent Book object |
| 57 | var Book = Storable.defineClass(store, "Book"); |
| 58 | |
| 59 | // Book objects can now be accessed via the |
| 60 | // Storable data access methods and scripted |
| 61 | // via Book.prototype |
| 62 | Book.prototype.toString = function() this.title; |
| 63 | |
| 64 | var b = new Book({title: 'JS for dummies'}); |
| 65 | b.save(); |
| 66 | |
| 67 | A store implementation can be any JavaScript object that implements the folloing functions: |
| 68 | |
| 69 | * all(type) - get all objects of one type |
| 70 | * get(type, id) - get a single object for its id |
| 71 | * query() - get a query object |
| 72 | * getEntity(key|properties) - get an entity object |
| 73 | * getKey(entity) - get the key object |
| 74 | * getProps(entitiy) - get the properties object |
| 75 | * equalKeys(key1, key2) - check if keys are equal |
| 76 | * save(props, entitiy, tx) - save object to db |
| 77 | * remove(key, tx) - remove object from db |
| 78 | * getId(key) - get the object id |
| 79 |
Version 23 by hannes on 08. August 2009, 12:59
| 13 | The current Git snapshot implements preliminary query functionality for the googlestore, berkeleystore, filestore, memstore backends. Note that while googlestore uses the indexes and berkeleystore use indxing and query functionality provided by Google's datastore APIthe underlying libraries and APIs, filestore and memstore use unindexed, brute force query implementations that require a full read of the queried objects. Berkeleystore |
Version 22 by hannes on 30. July 2009, 18:34
| 21 | * <b>query.less('propertyName', propertyValue)</b> Returns a subquery with the added less-than filter. |
| 22 | |
| 26 | * <b>query.greaterEquals('propertyName', propertyValue)</b> Returns a subquery with the added greater-than greater-than-or-equals filter. |
Version 21 by hannes on 30. July 2009, 18:10
| 15 | * <b>Type.query()</b>query()</b> Returns a query object for the Storable type represented by the given constructor. |
| 16 | Returns a query object for the Storable type represented by the given constructor. |
| 17 | * <b>query.equals('propertyName', propertyValue)</b>propertyValue)</b> Returns a subquery with the added equality filter. |
| 18 | Returns a subquery with the added equality filter. |
| 19 | * <b>query.less('propertyName', propertyValue)</b>propertyValue)</b> Returns a subquery with the added less-than filter. |
| 20 | Returns a subquery with the added less-than filter. |
| 21 | * <b>query.less('propertyName', propertyValue)</b>propertyValue)</b> Returns a subquery with the added less-than filter. |
| 22 | Returns a subquery with the added less-than filter. |
| 23 | * <b>query.lessEquals('propertyName', propertyValue)</b>propertyValue)</b> Returns a subquery with the added less-than-or-equals filter. |
| 24 | Returns a subquery with the added less-than-or-equals filter. |
| 25 | * <b>query.greater('propertyName', propertyValue)</b>propertyValue)</b> Returns a subquery with the added greater-than filter. |
| 26 | Returns a subquery with the added greater-than filter. |
| 27 | * <b>query.greaterEquals('propertyName', propertyValue)</b>propertyValue)</b> Returns a subquery with the added greater-than filter. |
| 28 | Returns a subquery with the added greater-than filter. |
| 29 | * <b>query.select('propertyName')</b>)</b> Returns an array containing the result of the query. If propertyName argument is defined, the result array only contains the given property of the selected objects. Otherwise, it contains the whole objects. |
| 30 | Returns an array containing the result of the query. If propertyName argument is defined, the result array only contains the given property of the selected objects. Otherwise, it contains the whole objects. |
Version 20 by hannes on 30. July 2009, 18:09
| 10 | Collecting links of prior art and to collect more ideas on this. |
| 11 | ==== Preliminary Design |
| 12 | |
| 13 | The current Git snapshot implements preliminary query functionality for the googlestore, filestore, memstore backends. Note that while googlestore uses the indexes provided by Google's datastore API, filestore and memstore use unindexed, brute force query implementations that require a full read of the queried objects. |
| 14 | |
| 15 | * <b>Type.query()</b> |
| 16 | Returns a query object for the Storable type represented by the given constructor. |
| 17 | |
| 18 | * <b>query.equals('propertyName', propertyValue)</b> |
| 19 | Returns a subquery with the added equality filter. |
| 20 | |
| 21 | * <b>query.less('propertyName', propertyValue)</b> |
| 22 | Returns a subquery with the added less-than filter. |
| 23 | |
| 24 | * <b>query.less('propertyName', propertyValue)</b> |
| 25 | Returns a subquery with the added less-than filter. |
| 26 | |
| 27 | * <b>query.lessEquals('propertyName', propertyValue)</b> |
| 28 | Returns a subquery with the added less-than-or-equals filter. |
| 29 | |
| 30 | * <b>query.greater('propertyName', propertyValue)</b> |
| 31 | Returns a subquery with the added greater-than filter. |
| 32 | |
| 33 | * <b>query.greaterEquals('propertyName', propertyValue)</b> |
| 34 | Returns a subquery with the added greater-than filter. |
| 35 | |
| 36 | * <b>query.select('propertyName')</b> |
| 37 | Returns an array containing the result of the query. If propertyName argument is defined, the result array only contains the given property of the selected objects. Otherwise, it contains the whole objects. |
| 38 | |
| 12 | |
| 13 | Collecting links of prior art and to collect more ideas on this. |
| 14 |
Version 19 by simono on 29. July 2009, 16:49
| 2 | * *Berkeley storable|http://github.com/hns/berkeleystore/tree/master* backend for the Helma NG Storable interface based on the Berkeley DB |
Version 18 by robi42 on 19. July 2009, 02:40
| 23 | * *LINQ |http://msdn.microsoft.com/de-at/library/bb308959(en-us).aspx* ("language-integrated query" developed by MS for .NET), JS impl. available: |
Version 17 by robi42 on 19. July 2009, 02:15
| 23 | * *LINQ |http://msdn.microsoft.com/de-at/library/bb308959(en-us).aspx*aspx* ("language-integrated query" developed by MS for .NET) |
Version 16 by robi42 on 19. July 2009, 02:08
| 23 | * *LINQ |http://msdn.microsoft.com/de-at/library/bb308959(en-us).aspx* |
| 24 | ** *jLinq |http://www.hugoware.net* |
| 25 | ** *JSLINQ |http://www.codeplex.com/JSLINQ* |
Version 15 by simono on 06. July 2009, 15:27
| 20 | * Django's query interface http://docs.djangoproject.com/en/dev/topics/db/queries/#retrieving-specific-objects-with-filters (replaced named parameters with a JS object) |
| 21 | ** only django's ORM part could be packaged as jar (jython2.5) |
| 22 | ** enhanced googlestore query interface nearly identical to djangos |
Version 14 by sleepnova on 25. June 2009, 19:20
- Changed tags to ORM, persistence, datastore, data-binding
Version 13 by sleepnova on 25. June 2009, 19:19
| 9 | === Query API design* (planning)design |
| 11 | ==== ReferencesPrior Art |
| 15 | * App Engine DatastoreDatastore *Low-level API - Query |http://code.google.com/intl/en/appengine/docs/java/javadoc/com/google/appengine/api/datastore/Query.html* |
| 16 | ** *Low-level API - Query |http://code.google.com/intl/en/appengine/docs/java/javadoc/com/google/appengine/api/datastore/Query.html* |
| 18 | * Mozilla ServerJS *Relational Database Interface |https://wiki.mozilla.org/ServerJS/RDBMS* |
| 19 | * Persevere *JSONQuery |http://docs.persvr.org/documentation/jsonquery* |
| 20 |
Version 12 by liamstask on 19. June 2009, 22:46
| 18 | ** Provides Ruby-based ORM that provides nice modules that a variety of backends (rdbms and others) can mix in to provide common features like validation, lazy/eager loading, in addition to a nice query api |
Version 11 by zumbrunn on 18. June 2009, 21:03
| 13 | ** *A Developer's Tour - Advanced Queries | http://www|http://www.mongodb.org/display/DOCS/Advanced+Queries* |
| 14 | ** *Developers' Guide - Searching and Retrieving | http://www|http://www.mongodb.org/display/DOCS/Searching+and+Retrieving* |
| 15 | ** *Low-level API - Query | http://code|http://code.google.com/intl/en/appengine/docs/java/javadoc/com/google/appengine/api/datastore/Query.html* |
Version 10 by liamstask on 18. June 2009, 18:08
| 17 | * DataMapper - http://datamapper.org/doku.php?id=docs |
| 18 | ** Provides nice modules that a variety of backends (rdbms and others) can mix in to provide common features like validation, lazy/eager loading, in addition to a nice query api |
Version 9 by sleepnova on 18. June 2009, 17:41
| 12 | * MongoDB APIMongoDB |
| 13 | ** *A Developer's Tour - Advanced Queries | http://www.mongodb.org/display/DOCS/Advanced+Queriesorg/display/DOCS/Advanced+Queries* |
| 14 | ** *Developers' Guide - Searching and Retrieving | http://www.mongodb.org/display/DOCS/Searching+and+Retrievingorg/display/DOCS/Searching+and+Retrieving* |
| 15 | * App Engine Datastore APIDatastore |
| 16 | ** *Low-level API - Query | http://code.google.com/intl/en/appengine/docs/java/javadoc/com/google/appengine/api/datastore/package-summarycom/intl/en/appengine/docs/java/javadoc/com/google/appengine/api/datastore/Query.htmlhtml* |
Version 8 by sleepnova on 18. June 2009, 17:36
| 8 | |
| 9 | === Query API design* (planning) |
| 10 | Collecting links of prior art and to collect more ideas on this. |
| 11 | ==== References |
| 12 | * MongoDB API |
| 13 | ** http://www.mongodb.org/display/DOCS/Advanced+Queries |
| 14 | ** http://www.mongodb.org/display/DOCS/Searching+and+Retrieving |
| 15 | * App Engine Datastore API |
| 16 | ** http://code.google.com/intl/en/appengine/docs/java/javadoc/com/google/appengine/api/datastore/package-summary.html |
Version 7 by hannes on 17. April 2009, 13:36
| 7 | * Liam Staskawicz is working on a *Helma NG module|http://bitbucket.org/liamstask/mongolovehelma/* for *MongoDB|http://www.mongodb.org/*. |
Version 6 by hannes on 13. April 2009, 00:11
| 5 | * Google App Engine *datastore module|http://github.com/hns/helma-ng/blob/e102a1982e25069489c5efcd14fb829fb66fa0c9/modules/helma/googlestore.js* and *demo app|http://github.com/hns/helma-ng/tree/e102a1982e25069489c5efcd14fb829fb66fa0c9/apps/googlestore* com/hns/helma-ng/tree/35d42b5ca2f008fc00e2529d7fedea286acb1323/apps/googlestore* (*running on App Engine|http://helma-storage.appspot.com/*) |
Version 5 by hannes on 12. April 2009, 23:35
| 5 | * Google App Engine *googlestore *datastore module|http://github.com/hns/helma-ng/blob/e102a1982e25069489c5efcd14fb829fb66fa0c9/modules/helma/googlestore.js* and *demo app|http://github.com/hns/helma-ng/tree/e102a1982e25069489c5efcd14fb829fb66fa0c9/apps/googlestore* (*running on App Engine|http://helma-storage.appspot.com/*) |
| 6 | * *padded-ng|http://github.com/leobm/padded-ng/tree/master* is a CouchDB client by Jan-Felix Wittmann. |
Version 4 by hannes on 12. April 2009, 22:40
| 5 | * Google App Engine *googlestore module|http://github.com/hns/helma-ng/blob/e102a1982e25069489c5efcd14fb829fb66fa0c9/modules/helma/googlestore.js* and *demo app|http://github.com/hns/helma-ng/tree/e102a1982e25069489c5efcd14fb829fb66fa0c9/apps/googlestore* (*running on App Engine|http://helma-storage.appspot.com/*) |
Version 3 by hannes on 20. February 2009, 22:59
| 4 | * Helma NG *filestore module|http://githubmodule|helma.com/hns/helma-ng/blob/89a30cf8b6f83e8f180a6d87d45d30f57fdeefde/modules/helma/filestore.js* filestore* and *demo app|http://github.com/hns/helma-ng/tree/2ee6966a4ca6f27437c197cf769bf926a528eafc/apps/storage* |
Version 2 by hannes on 20. February 2009, 20:19
- Changed tags to ORM, persistence
| 1 | === Current efforts |
| 2 |
Version 1 by hannes on 20. February 2009, 20:17
- Set tags to ORM
| 1 | * *Hibernate wrapper for Helma NG|http://github.com/robi42/dbstore/tree/master* and *demo app|http://github.com/robi42/blog-ng/tree/master* by Robert Thurnher |
| 2 | * Helma NG *filestore module|http://github.com/hns/helma-ng/blob/89a30cf8b6f83e8f180a6d87d45d30f57fdeefde/modules/helma/filestore.js* and *demo app|http://github.com/hns/helma-ng/tree/2ee6966a4ca6f27437c197cf769bf926a528eafc/apps/storage* |