This package has been deprecated

Author message:

this package has been moved to @dandi-contrib/data-pg

@dandi/data-pg
TypeScript icon, indicating that this package has built-in type declarations

1.0.0-alpha.29 • Public • Published

@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,
    })

    ...

  ],
});

/@dandi/data-pg/

    Package Sidebar

    Install

    npm i @dandi/data-pg

    Weekly Downloads

    16

    Version

    1.0.0-alpha.29

    License

    MIT

    Unpacked Size

    39.4 kB

    Total Files

    36

    Last publish

    Collaborators

    • danielschaffer