2.0.0-pre.19 • Published 9 years ago

@ampatspell/ember-cli-sofa v2.0.0-pre.19

Weekly downloads
-
License
MIT
Repository
bitbucket
Last release
9 years ago

ember-cli-sofa

This documentation is also available at http://sofa.amateurinmotion.com

Sofa is full featured and easy to use CouchDB persistence addon for Ember.js.

Install

ember install @ampatspell/ember-cli-sofa

Setup

Easiest way to start using sofa, is by extending Store service:

// services/store.js
import { Store } from 'sofa';

const url = 'http://127.0.0.1:5984';

const mapping = {
  main: 'awesome-app',
  users: '_users'
};

export default Store.extend({

  databaseOptionsForIdentifier(identifier) {
    let name = mapping[identifier];
    if(!name) {
      return;
    }
    return { url, name };
  }

});

sofa supports multiple CouchDB hosts and databases (soon also PouchDB). Each database in application is accessed by using identifier. To map identifiers to CouchDB database urls, override databaseOptionsForIdentifier(identifier) and return { url, name } object.

For example, if app queries http://127.0.0.1:5984 /awesome-app and /_users CouchDB databases, you can configure Store by using example above to refer to those using main and users identifiers.

2.0.0-pre.19

9 years ago

2.0.0-pre.18

9 years ago

2.0.0-pre.17

9 years ago

2.0.0-pre.16

9 years ago

2.0.0-pre.15

9 years ago

2.0.0-pre.14

9 years ago

2.0.0-pre.13

9 years ago

2.0.0-pre.12

9 years ago

2.0.0-pre.11

9 years ago

2.0.0-pre.10

9 years ago

2.0.0-pre.9

9 years ago

2.0.0-pre.8

9 years ago

2.0.0-pre.7

9 years ago

2.0.0-pre.6

9 years ago

2.0.0-pre.5

9 years ago

2.0.0-pre.4

9 years ago

2.0.0-pre.3

9 years ago

2.0.0-pre.2

9 years ago

2.0.0-pre.1

9 years ago

1.0.12

10 years ago

1.0.11

10 years ago

1.0.10

10 years ago

1.0.9

10 years ago

1.0.8

10 years ago

1.0.7

10 years ago

1.0.6

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago