Here are the steps to follow to create a new store
- Create your store
.ts
file in thesrc/stores/
directory - Create and export your
IDBStoreOptions
interface extending theStoreOption
interface. - Create your
DBStore
class with the following attributes:- The
constructor
function needs to accept yourIDBStoreOptions
interface as the input. - There needs to be a public
store
function that complies to theStoreFunc
type.
- The
- Export your
DBStore
class as the default export. - Modify the
src/index.ts
file with the following:- Import your store's default export as the same name of your store. eg:
sql
- Import your store's
IDBStoreOptions
following the same naming conventions. eg:sqlOpts
- Add your store to the
stores
object. - Add your store options to the
StoreOptions
object. The key should be the same as the name of your store.
- Import your store's default export as the same name of your store. eg:
- If applicable, create a
package.json
script to start a docker run for your storage solution. Refer to:sureal:test
. - If applicable, update the
pretest
script to include your docker run script. - Create a jest test in the
tests
folder for your store. This test should at the bare minimum, store thesample.hl7
file in your store, then retrieve it, and compare it with the sample to ensure that the storage and retrieval messages map. - Update the
README.md
- Create a PR against this repo with your new changes.