2.2.29 • Published 6 months ago

@flexiblepersistence/sequelize v2.2.29

Weekly downloads
123
License
MIT
Repository
github
Last release
6 months ago

sequelizePersistence

Publish npm version npm downloads

A Sequelize 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/sequelize

or

$ yarn add @flexiblepersistence/sequelize

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.2.28

7 months ago

2.2.29

6 months ago

2.2.26

7 months ago

2.2.27

7 months ago

2.2.24

10 months ago

2.2.25

7 months ago

2.2.17

1 year ago

2.2.1

1 year ago

2.2.18

1 year ago

2.2.15

1 year ago

2.2.3

1 year ago

2.2.16

1 year ago

2.2.2

1 year ago

2.2.13

1 year ago

2.2.5

1 year ago

2.2.14

1 year ago

2.2.4

1 year ago

2.2.11

1 year ago

2.2.7

1 year ago

2.2.12

1 year ago

2.2.6

1 year ago

2.2.10

1 year ago

2.2.19

1 year ago

2.2.22

12 months ago

2.2.23

12 months ago

2.2.21

1 year ago

2.2.9

1 year ago

2.2.8

1 year ago

2.1.0

1 year ago

2.0.8

1 year ago

2.0.7

2 years ago

2.0.6

2 years ago

2.0.2

2 years ago

2.0.5

2 years ago

2.0.4

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago

0.0.16

3 years ago

0.0.15

3 years ago

0.0.14

3 years ago

0.0.13

3 years ago

0.0.12

3 years ago

0.0.11

3 years ago

0.0.10

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago