Documentation for pulsar 0.9.2. For development docs, go here.
Pulsar is shipped with a Store
implementation for redis
and pulsard-ds servers.
pulsar.apps.data.stores.redis.store.
RedisStore
(name, host, loop=None, database=None, user=None, password=None, encoding=None, **kw)[source]¶Redis Store
implementation.
namespace
¶The prefix namespace to append to all transaction on keys
client
()[source]¶Get a RedisClient
for the Store
execute_transaction
(transaction)[source]¶Execute a Transaction
pulsar.apps.data.stores.redis.client.
RedisClient
(store)[source]¶Client for RedisStore
.
store
¶The RedisStore
for this client.
zadd
(name, *args, **kwargs)[source]¶Set any number of score, element-name pairs to the key name
. Pairs
can be specified in two ways:
As *args
, in the form of:
score1, name1, score2, name2, ...
or as **kwargs
, in the form of:
name1=score1, name2=score2, ...
The following example would add four values to the ‘my-key’ key:
client.zadd('my-key', 1.1, 'name1', 2.2, 'name2',
name3=3.3, name4=4.4)
sort
(key, start=None, num=None, by=None, get=None, desc=False, alpha=False, store=None, groups=False)[source]¶Sort and return the list, set or sorted set at key
.
start
and num
allow for paging through the sorted data
by
allows using an external key to weight and sort the items.get
allows for returning items from external keys rather than thedesc
allows for reversing the sort
alpha
allows for sorting lexicographically rather than numerically
store
allows for storing the result of the sort intostore
groups
if set to True and if get
contains at least twoget
.It has the same implementation as redis client.
CouchDB document store:
store = create_store('http+couchdb://localhost:5984/mydb')
A Model
is stored as a document in the store database, this
means instances of different models which use the same couchdb store
are stored in exactly the same database.
To differentiate and query over different types of models, the
Type
field is added to the document representing a model.
pulsar.apps.data.stores.couchdb.store.
CouchDBStore
(name, host, loop=None, database=None, user=None, password=None, encoding=None, **kw)[source]¶ping
()¶Information about the running server
create_database
(dbname=None, **kw)[source]¶Create a new database
Parameters: | dbname – optional database name. If not provided
the _database is created instead. |
---|
update_documents
(dbname, documents, new_edits=True)[source]¶Bulk update/insert of documents in a database