0.35.0 • Published 30 days ago

@expo/entity-database-adapter-knex v0.35.0

Weekly downloads
72
License
MIT
Repository
-
Last release
30 days ago

@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),
      },
    },
    {
      ...
    }
  );
};
0.35.0

30 days ago

0.34.0

30 days ago

0.33.0

7 months ago

0.32.0

11 months ago

0.31.1

1 year ago

0.31.0

1 year ago

0.30.0

1 year ago

0.29.0

2 years ago

0.28.0

2 years ago

0.27.0

2 years ago

0.26.1

2 years ago

0.26.0

2 years ago

0.21.0

2 years ago

0.20.0

2 years ago

0.25.3

2 years ago

0.25.2

2 years ago

0.25.1

2 years ago

0.25.0

2 years ago

0.24.0

2 years ago

0.23.0

2 years ago

0.22.0

2 years ago

0.19.0

3 years ago

0.18.0

3 years ago

0.17.0

3 years ago

0.16.0

3 years ago

0.15.0

3 years ago

0.14.0

3 years ago

0.14.1

3 years ago

0.13.0

3 years ago

0.12.0

3 years ago

0.11.0

3 years ago

0.10.0

3 years ago

0.9.1

4 years ago

0.9.0

4 years ago

0.8.1

4 years ago

0.8.0

4 years ago

0.7.1

4 years ago

0.7.0

4 years ago

0.6.0

4 years ago

0.5.2

4 years ago

0.5.1

4 years ago

0.5.0

4 years ago

0.4.0

4 years ago

0.3.0

4 years ago