@sivrad/matrix
v1.0.39
Published
An opinionated schema-based database interface for the modern world.
Readme
Installation
yarn add @sivrad/matrixUsage
Create Matrix Instance
// Import Matrix from this package.
import { Matrix } from '@sivrad/matrix';
// Create an instance and pass all the collections.
const mtx = new Matrix([exampleCollection]);Get Collection
console.log(mtx.getCollection('example'));Get a Type
console.log(mtx.getType('example.ExampleThing'));The rest of this is meant to be used by generated code with the collection-tools package.
Contributing
These are the steps to contribute to the Matrix Package.
Post Git Clone
Install Dependencies
Install node dependencies with yarn.
yarnGenerate Internal Types
This generates internal types from the JSON schemas from this repo.
yarn generate-typesBuilding the Package
This script will build the package and transpile the code to Javascript.
yarn buildAdditionally, you can just build the src/types/* files with:
yarn build-typesThis is usefull if you don't want to transpile into Javascript every time you change something.
