@dandi/data-pg

`@dandi/data-pg` wraps the [node-postgres](https://node-postgres.com/) client in implementations of `@dandi/data`'s interfaces.

Stats

StarsIssuesVersionUpdatedCreatedSize
@dandi/data-pg
1.0.0-alpha.293 years ago3 years agoMinified + gzip package size for @dandi/data-pg in KB

Readme

@dandi/data-pg

@dandi/data-pg wraps the node-postgres client in implementations of @dandi/data's interfaces.

See @dandi/data for basic usage and configuration.

Using @dandi/data-pg In Your App

In addition to setting up the connection and authentication data described in @dandi/data, include PgDbModule in your Container providers:

import { Container } from '@dandi/core';
import { PgDbModule } from '@dandi/data-pg';

const myApp = new Container({
  providers: [

    ...

    // database
    PgDbModule,

    ...

  ],
});

Configuring ModelBuilder

Include a Provider<ModelBuilderOptions> for PgDbModelBuilderOptions in your Container providers:

import { Container } from '@dandi/core';
import { PgDbModelBuilderOptions, PgDbModule } from '@dandi/data-pg';
import { ModelBuilderOptions } from '@dandi/model-builder';

import { camel } from 'change-case';

const myApp = new Container({
  providers: [

    ...

    ModelBuilderOptions.provider(PgDbModelBuilderOptions, {
      keyTransform: camel,
    })

    ...

  ],
});

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.