@expo/entity-database-adapter-knex
Knex database adapter for @expo/entity
Last updated 2 days ago by wschurman .
MIT · Original npm · Tarball · package.json
$ cnpm install @expo/entity-database-adapter-knex 
SYNC missed versions from official npm registry.

@expo/entity-database-adapter-knex

Knex database adapter for @expo/entity. Currently only used with Postgres client.

Documentation

Usage

During EntityCompanionProvider instantiation:

import { knex, Knex } from 'knex';

const knexInstance = knex({
  client: 'pg',
  connection: {
    user: process.env['PGUSER'],
    password: process.env['PGPASSWORD'],
    host: process.env['PGHOST'],
    port: parseInt(nullthrows(process.env['PGPORT']), 10),
    database: process.env['PGDATABASE'],
  },
});

export const createDefaultEntityCompanionProvider = (
  metricsAdapter: IEntityMetricsAdapter = new NoOpEntityMetricsAdapter()
): EntityCompanionProvider => {
  return new EntityCompanionProvider(
    metricsAdapter,
    {
      // add the knex database adapter flavor
      ['postgres']: {
        adapter: PostgresEntityDatabaseAdapter,
        queryContextProvider: new PostgresEntityQueryContextProvider(knexInstance),
      },
    },
    {
      ...
    }
  );
};

Current Tags

  • 0.18.0                                ...           latest (2 days ago)

22 Versions

  • 0.18.0                                ...           2 days ago
  • 0.17.0                                ...           2 months ago
  • 0.16.0                                ...           3 months ago
  • 0.15.0                                ...           5 months ago
  • 0.14.1                                ...           7 months ago
  • 0.14.0                                ...           7 months ago
  • 0.13.0                                ...           8 months ago
  • 0.12.0                                ...           9 months ago
  • 0.11.0                                ...           10 months ago
  • 0.10.0                                ...           a year ago
  • 0.9.1                                ...           a year ago
  • 0.9.0                                ...           a year ago
  • 0.8.1                                ...           a year ago
  • 0.8.0                                ...           a year ago
  • 0.7.1                                ...           a year ago
  • 0.7.0                                ...           a year ago
  • 0.6.0                                ...           a year ago
  • 0.5.2                                ...           a year ago
  • 0.5.1                                ...           a year ago
  • 0.5.0                                ...           a year ago
  • 0.4.0                                ...           a year ago
  • 0.3.0                                ...           a year ago
Downloads
Today 0
This Week 9
This Month 10
Last Day 1
Last Week 1
Last Month 2
Dependencies (1)
Dev Dependencies (1)
Dependents (0)
None

Copyright 2014 - 2021 © npmmirror.com |