0.3.4 • Published 3 months ago

@directus/data v0.3.4

Weekly downloads
-
License
BUSL-1.1
Repository
github
Last release
3 months ago

@directus/data

Warning This is a work in progress. Nothing is expected to work yet.

Installation

npm install @directus/data

The installation of a driver is also required.

Usage

Setup

import { DataEngine } from '@directus/data';
import { DataDriverPostgres } from '@directus/data-driver-postgres';

// Instantiate the engine
const engine = new DataEngine();

// Instantiate a driver
const pgDriver = new DataDriverPostgres({
	connectionString: 'postgresql://root:password@localhost/mydb',
});

// register the driver to the engine
await engine.registerStore('postgres', pgDriver);

Query data

// query data
await engine.query({
	store: 'postgres',
	collection: 'articles',
	fields: [
		{
			type: 'primitive',
			field: 'id',
		},
	],
});

The above is resulting in the following flow.

graph TB;
    api --> data
	subgraph da[data abstraction]
		direction TB
		data --> data-driver-x --> db1[(datastore)]
		data --> data-driver-y --> db2[(datastore)]
	end

Current architecture of this package

To get an overview of how the package is organized regarding it's files, directories and the dependencies between them, run pnpm run depcruise and have a look in the created dependency-graph.svg image.

0.3.4

3 months ago

0.3.3

3 months ago

0.3.2

4 months ago

0.3.1

5 months ago

0.3.0

7 months ago

0.2.1

10 months ago

0.2.0

11 months ago

0.1.0

11 months ago

0.0.2

11 months ago

0.0.1

1 year ago