Skip to content

Latest commit

 

History

History
138 lines (93 loc) · 3.61 KB

storage.rst

File metadata and controls

138 lines (93 loc) · 3.61 KB

Storage

DStore provides an abstraction layer to store the model instances.

Memory

Introduction

The default storage in DStore is the MemoryStore.

This simply stores the model instances in an array in memory.

Keep in mind that this storage type is runtime only, meaning that the data is wiped when the application closes.

Usage

from dstore import MemoryStore
store = MemoryStore( models )

MySQL

Introduction

This storage type allows model instances to be stored in a MySQL DataBase.

In order to use this storage type, you need to install the Python Package for it.

Installing

You have two choices to install dstore-mysql, using pip or from source.

From PyPi

DStore is available from the PyPi repository at DStore.

This means that all you have to do to install PyMan is run the following in a console:

$ pip install dstore-mysql

From Source

DStore can also be installed from source by downloading from GitHub and running setup.py.

$ wget https://github.com/MarkLark/dstore-mysql/archive/master.tar.gz
$ tar xvf master.tar.gz
$ cd dstore-mysql-master
$ python setup.py install

Requirements

DStore-MySQL requires the Python package MySQL-python.

Usage

from dstore_mysql import MySQLStore
store = MySQLStore( models )

MongoDB

Introduction

This storage type allows model instances to be stored in a Mongo DataBase.

In order to use this storage type, you need to install the Python Package for it.

Installing

You have two choices to install dstore-mongo, using pip or from source.

From PyPi

DStore-Mongo package is available from the PyPi repository.

This means that all you have to do to install PyMan is run the following in a console:

$ pip install dstore-mongo

From Source

DStore-Mongo can also be installed from source by downloading from GitHub and running setup.py.

$ wget https://github.com/MarkLark/dstore-mongo/archive/master.tar.gz
$ tar xvf master.tar.gz
$ cd dstore-mongo-master
$ python setup.py install

Requirements

DStore-Mongo requires the Python package PyMongo.

Usage

from dstore_mongo import MongoStore
store = MongoStore( models )