Skip to content

Commit

Permalink
fix: upgrade ioredis, knex, and pg
Browse files Browse the repository at this point in the history
  • Loading branch information
wschurman committed May 26, 2021
1 parent 4cba01e commit 71b1920
Show file tree
Hide file tree
Showing 21 changed files with 161 additions and 293 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@expo/entity": "file:packages/entity",
"@expo/results": "^1.0.0",
"@types/invariant": "^2.2.33",
"@types/ioredis": "^4.17.3",
"@types/ioredis": "^4.26.4",
"@types/jest": "^26.0.10",
"@types/node": "^14.6.0",
"@types/uuid": "^8.3.0",
Expand All @@ -31,7 +31,7 @@
"jest": "^26.6.3",
"lerna": "^3.22.1",
"nullthrows": "^1.1.1",
"pg": "^8.3.2",
"pg": "^8.6.0",
"prettier": "^2.1.0",
"ts-jest": "~26.4.4",
"ts-mockito": "^2.6.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/entity-cache-adapter-redis/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"@expo/entity": "*"
},
"dependencies": {
"ioredis": "^4.17.3"
"ioredis": "^4.27.3"
},
"devDependencies": {
"@expo/entity": "^0.14.1"
Expand Down
4 changes: 2 additions & 2 deletions packages/entity-database-adapter-knex/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
During `EntityCompanionProvider` instantiation:

```typescript
import Knex from 'knex';
import { knex, Knex } from 'knex';

const knexInstance = Knex({
const knexInstance = knex({
client: 'pg',
connection: {
user: process.env.PGUSER,
Expand Down
2 changes: 1 addition & 1 deletion packages/entity-database-adapter-knex/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"@expo/entity": "*"
},
"dependencies": {
"knex": "^0.21.5"
"knex": "^0.95.6"
},
"devDependencies": {
"@expo/entity": "^0.14.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
TableFieldSingleValueEqualityCondition,
TableFieldMultiValueEqualityCondition,
} from '@expo/entity';
import Knex from 'knex';
import { Knex } from 'knex';

import wrapNativePostgresCall from './errors/wrapNativePostgresCall';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { EntityQueryContextProvider } from '@expo/entity';
import Knex from 'knex';
import { Knex } from 'knex';

/**
* Query context provider for knex (postgres).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
ViewerContext,
} from '@expo/entity';
import { enforceAsyncResult } from '@expo/results';
import Knex from 'knex';
import { knex, Knex } from 'knex';

import PostgresTestEntity from '../testfixtures/PostgresTestEntity';
import PostgresTriggerTestEntity from '../testfixtures/PostgresTriggerTestEntity';
Expand All @@ -16,7 +16,7 @@ describe('postgres entity integration', () => {
let knexInstance: Knex;

beforeAll(() => {
knexInstance = Knex({
knexInstance = knex({
client: 'pg',
connection: {
user: process.env.PGUSER,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ViewerContext } from '@expo/entity';
import { enforceAsyncResult } from '@expo/results';
import Knex from 'knex';
import { knex, Knex } from 'knex';

import InvalidTestEntity from '../testfixtures/InvalidTestEntity';
import { createKnexIntegrationTestEntityCompanionProvider } from '../testfixtures/createKnexIntegrationTestEntityCompanionProvider';
Expand All @@ -9,7 +9,7 @@ describe('postgres entity integration', () => {
let knexInstance: Knex;

beforeAll(() => {
knexInstance = Knex({
knexInstance = knex({
client: 'pg',
connection: {
user: process.env.PGUSER,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { ViewerContext } from '@expo/entity';
import {
ViewerContext,
EntityDatabaseAdapterCheckConstraintError,
EntityDatabaseAdapterExclusionConstraintError,
EntityDatabaseAdapterForeignKeyConstraintError,
EntityDatabaseAdapterNotNullConstraintError,
EntityDatabaseAdapterTransientError,
EntityDatabaseAdapterUniqueConstraintError,
EntityDatabaseAdapterUnknownError,
} from '@expo/entity/build/errors/EntityDatabaseAdapterError';
import Knex from 'knex';
} from '@expo/entity';
import { knex, Knex } from 'knex';

import ErrorsTestEntity from '../testfixtures/ErrorsTestEntity';
import { createKnexIntegrationTestEntityCompanionProvider } from '../testfixtures/createKnexIntegrationTestEntityCompanionProvider';
Expand All @@ -17,7 +17,7 @@ describe('postgres errors', () => {
let knexInstance: Knex;

beforeAll(() => {
knexInstance = Knex({
knexInstance = knex({
client: 'pg',
connection: {
user: process.env.PGUSER,
Expand Down Expand Up @@ -45,7 +45,7 @@ describe('postgres errors', () => {
.setField('fieldNonNull', 'hello')
.enforceCreateAsync();

const shortTimeoutKnexInstance = Knex({
const shortTimeoutKnexInstance = knex({
client: 'pg',
connection: {
user: process.env.PGUSER,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
EntityDatabaseAdapterUniqueConstraintError,
EntityDatabaseAdapterUnknownError,
} from '@expo/entity';
import { KnexTimeoutError } from 'knex';
import { knex } from 'knex';

function wrapNativePostgresError(
error: Error & { code: string | undefined }
Expand All @@ -21,7 +21,7 @@ function wrapNativePostgresError(
function translatePostgresError(
error: Error & { code: string | undefined }
): EntityDatabaseAdapterError & Error {
if (error instanceof KnexTimeoutError) {
if (error instanceof knex.KnexTimeoutError) {
return new EntityDatabaseAdapterTransientError(error.message, error);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
Entity,
NumberField,
} from '@expo/entity';
import Knex from 'knex';
import { Knex } from 'knex';

type ErrorsTestEntityFields = {
id: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
Entity,
NumberField,
} from '@expo/entity';
import Knex from 'knex';
import { Knex } from 'knex';

type InvalidTestEntityFields = {
id: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
EntityCompanionDefinition,
Entity,
} from '@expo/entity';
import Knex from 'knex';
import { Knex } from 'knex';

type PostgresTestEntityFields = {
id: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
EntityNonTransactionalMutationTrigger,
EntityMutationInfo,
} from '@expo/entity';
import Knex from 'knex';
import { Knex } from 'knex';

type PostgresTriggerTestEntityFields = {
id: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
EntityQueryContext,
EntityMutationInfo,
} from '@expo/entity';
import Knex from 'knex';
import { Knex } from 'knex';

type PostgresValidatorTestEntityFields = {
id: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
EntityCompanionProvider,
InMemoryFullCacheStubCacheAdapterProvider,
} from '@expo/entity';
import Knex from 'knex';
import { Knex } from 'knex';

import PostgresEntityDatabaseAdapterProvider from '../PostgresEntityDatabaseAdapterProvider';
import PostgresEntityQueryContextProvider from '../PostgresEntityQueryContextProvider';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
} from '@expo/entity';
import { RedisCacheAdapterContext } from '@expo/entity-cache-adapter-redis';
import Redis from 'ioredis';
import Knex from 'knex';
import { knex, Knex } from 'knex';
import { URL } from 'url';

import { createFullIntegrationTestEntityCompanionProvider } from '../testfixtures/createFullIntegrationTestEntityCompanionProvider';
Expand Down Expand Up @@ -104,7 +104,7 @@ describe('Entity cache inconsistency', () => {
let redisCacheAdapterContext: RedisCacheAdapterContext;

beforeAll(() => {
knexInstance = Knex({
knexInstance = knex({
client: 'pg',
connection: {
user: process.env.PGUSER,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ViewerContext } from '@expo/entity';
import { RedisCacheAdapterContext } from '@expo/entity-cache-adapter-redis';
import Redis from 'ioredis';
import Knex from 'knex';
import { knex, Knex } from 'knex';
import { URL } from 'url';

import { createFullIntegrationTestEntityCompanionProvider } from '../testfixtures/createFullIntegrationTestEntityCompanionProvider';
Expand Down Expand Up @@ -37,7 +37,7 @@ describe('EntityMutator.processEntityDeletionForInboundEdgesAsync', () => {
let redisCacheAdapterContext: RedisCacheAdapterContext;

beforeAll(() => {
knexInstance = Knex({
knexInstance = knex({
client: 'pg',
connection: {
user: process.env.PGUSER,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
} from '@expo/entity';
import { RedisCacheAdapterContext } from '@expo/entity-cache-adapter-redis';
import Redis from 'ioredis';
import Knex from 'knex';
import { knex, Knex } from 'knex';
import { URL } from 'url';
import { v4 as uuidv4 } from 'uuid';

Expand Down Expand Up @@ -166,7 +166,7 @@ describe('EntityMutator.processEntityDeletionForInboundEdgesAsync', () => {
let redisCacheAdapterContext: RedisCacheAdapterContext;

beforeAll(() => {
knexInstance = Knex({
knexInstance = knex({
client: 'pg',
connection: {
user: process.env.PGUSER,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
PostgresEntityDatabaseAdapterProvider,
PostgresEntityQueryContextProvider,
} from '@expo/entity-database-adapter-knex';
import Knex from 'knex';
import { Knex } from 'knex';

export const createFullIntegrationTestEntityCompanionProvider = (
knex: Knex,
Expand Down
Loading

0 comments on commit 71b1920

Please sign in to comment.