3.0.2 • Published 1 year ago

@flexiblepersistence/dao v3.0.2

Weekly downloads
135
License
MIT
Repository
github
Last release
1 year ago

dAOPersistence

Publish npm version npm downloads

A DAO implementation for Flexible Persistence's PersistenceAdapter

// Init Journaly as a observer platform for using as a message broker
const journaly = Journaly.newJournaly() as SubjectObserver<any>;

// config read database
read = new DAODB(database, {
  test: new TestDAO(),
  object: new ObjectDAO(),
});

// config write database
write = new MongoDB(
  new PersistenceInfo(
    {
      database: 'write',
      host: process.env.MONGO_HOST || 'localhost',
      port: process.env.MONGO_PORT,
    },
    journaly
  )
);

// init Flexible Persistence handler with write and read databases
const handler = new Handler(write, read);

// sample object
const obj = {};
obj['test'] = 'test';

// create an event to create an object
const persistencePromise = await handler.addEvent(
  new Event({ operation: Operation.create, name: 'object', content: obj })
);

// prints create event
console.log(persistencePromise);

Overview

Installation

This is a Node.js module available through the npm registry.

Before installing, download and install Node.js.

If this is a brand new project, make sure to create a package.json first with the npm init command or yarn init command.

Installation is done using the npm install command or yarn add command:

$ npm install @flexiblepersistence/dao

or

$ yarn add @flexiblepersistence/dao

Tests

To run the test suite, first install Docker and dependencies, then run docker-compose up -d and npm test:

$ docker-compose up -d
$ npm install
$ npm test

or

$ docker-compose up -d
$ yarn
$ yarn test

People

The original author of Journaly is Judah Lima

List of all contributors

2.4.1

1 year ago

2.4.0

1 year ago

3.0.2

1 year ago

3.0.1

1 year ago

3.0.0

1 year ago

3.0.0-beta

1 year ago

3.0.0-beta2

1 year ago

2.3.0

1 year ago

2.3.2

1 year ago

2.3.1

1 year ago

2.3.4

1 year ago

2.3.3

1 year ago

2.3.5

1 year ago

2.2.2

1 year ago

2.2.1

1 year ago

2.2.0

1 year ago

2.1.5

1 year ago

2.1.4

2 years ago

2.1.3

2 years ago

2.1.2

2 years ago

2.1.1

2 years ago

2.1.0

2 years ago

2.0.13

2 years ago

2.0.12

2 years ago

1.2.8

2 years ago

2.0.3

2 years ago

2.0.2

2 years ago

2.0.5

2 years ago

2.0.4

2 years ago

2.0.7

2 years ago

2.0.6

2 years ago

2.0.9

2 years ago

2.0.8

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

2.0.1-beta

2 years ago

1.2.10

2 years ago

1.3.0

2 years ago

2.0.11

2 years ago

2.0.10

2 years ago

2.0.5-beta

2 years ago

1.2.9

2 years ago

2.0.5-beta2

2 years ago

1.2.6

2 years ago

1.2.5

2 years ago

1.2.4

2 years ago

1.2.2

2 years ago

1.2.0

3 years ago

1.1.1

3 years ago

1.1.5

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.0

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.4.3

3 years ago

0.4.2

3 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.3.0

3 years ago

0.3.2

3 years ago

0.3.1

3 years ago

0.2.26

3 years ago

0.2.25

3 years ago

0.2.24

3 years ago

0.2.23

3 years ago

0.2.22

3 years ago

0.2.21

3 years ago

0.2.20

3 years ago

0.2.10

3 years ago

0.2.9

3 years ago

0.2.8

3 years ago

0.2.7

3 years ago

0.2.6

3 years ago

0.2.5

3 years ago

0.2.4

3 years ago

0.2.3

3 years ago

0.2.2

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.2

3 years ago

0.1.3

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago