/cta-silo

Primary LanguageJavaScriptOtherNOASSERTION

cta-silo

Build Status Coverage Status codecov

Silo Modules for Compass Test Automation, One of Libraries in CTA-OSS Framework

General Overview

Overview

The cta-silo provides a local storage to store data (documents). Currently, the cta-silo uses NeDB, the file-based JavaScript Database.

Guidelines

We aim to give you brief guidelines here.

  1. Usage
  2. Configuration
  3. Contracts

1. Usage

cta-silo extends Brick (cta-brick). In order to use it, we need to provide a configuration. The cta-silo has no dependencies.

const config = {
  name: 'silo-01',
  module: 'cta-silo',
  properties: {
    filename: `${__dirname}${path.sep}silo.db`,
  },
};

The data will be stored in silo.db file.

back to top

2. Configuration

The configuration requires properties.filename.

const config = {
  ...
  properties: {
    filename: `absolute/path/to/a/storage/file`,
  },
};

The properties.filename must be a filename with absolute path. The properties provide a configuration to NeDB.

back to top

3. Contracts

| nature.type | nature.quality | payload | --- | --- | --- | --- | documents | backup | { doc: { id: '01' } } or { doc: [ { id: '01' }, { id: '02' } ] } | documents | restore | { query: {}, clear: true } | documents | clear | { query: {} }

back to top


To Do

Considerations

Alternatives to NeDB are leveldb and EJDB