@expo/entity-database-adapter-knex
Knex database adapter for @expo/entity
Last updated an hour 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 from 'knex';

const knexInstance = Knex({
  client: 'pg',
  connection: {
    user: process.env.PGUSER,
    password: process.env.PGPASSWORD,
    host: process.env.PGHOST,
    port: parseInt(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
      [DatabaseAdapterFlavor.POSTGRES]: {
        adapter: PostgresEntityDatabaseAdapter,
        queryContextProvider: new PostgresEntityQueryContextProvider(knexInstance),
      },
    },
    {
      ...
    }
  );
};

Current Tags

  • 0.5.2                                ...           latest (an hour ago)

5 Versions

  • 0.5.2                                ...           an hour ago
  • 0.5.1                                ...           6 hours ago
  • 0.5.0                                ...           10 hours ago
  • 0.4.0                                ...           a month ago
  • 0.3.0                                ...           2 months ago
Downloads
Today 27
This Week 27
This Month 27
Last Day 0
Last Week 0
Last Month 10
Dependencies (1)
Dev Dependencies (1)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |