Skip to content

Commit

Permalink
Fix bad import in postgres/def
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyxiao committed Oct 12, 2023
1 parent 28765e9 commit 10d885c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 18 deletions.
6 changes: 4 additions & 2 deletions apps/app-config/backendConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ import {getServerUrl} from './constants'
import {env} from './env'
import {mergedIntegrations} from './integrations/integrations.merged'

export {makePostgresClient} from '@usevenice/integration-postgres'
export {DatabaseError} from '@usevenice/integration-postgres/makePostgresClient'
export {
DatabaseError,
makePostgresClient,
} from '@usevenice/integration-postgres/makePostgresClient'
export {Papa} from '@usevenice/integration-spreadsheet'

export const backendEnv = env
Expand Down
9 changes: 6 additions & 3 deletions integrations/integration-postgres/def.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ import {intHelpers} from '@usevenice/cdk-core'
import type {EntityPayloadWithExternal, ZCommon} from '@usevenice/cdk-ledger'
import {z, zCast} from '@usevenice/util'

import {zPgConfig} from './makePostgresClient'

export {makePostgresClient} from './makePostgresClient'
export const zPgConfig = z.object({
databaseUrl: z.string(),
migrationsPath: z.string().optional(),
migrationTableName: z.string().optional(),
transformFieldNames: z.boolean().optional(),
})

export const postgresSchemas = {
name: z.literal('postgres'),
Expand Down
10 changes: 2 additions & 8 deletions integrations/integration-postgres/makePostgresClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,12 @@ import {
memoize,
R,
snakeCase,
z,
zFunction,
} from '@usevenice/util'

export {DatabaseError} from 'pg'
import {zPgConfig} from './def'

export const zPgConfig = z.object({
databaseUrl: z.string(),
migrationsPath: z.string().optional(),
migrationTableName: z.string().optional(),
transformFieldNames: z.boolean().optional(),
})
export {DatabaseError} from 'pg'

export const makePostgresClient = zFunction(
zPgConfig,
Expand Down
7 changes: 2 additions & 5 deletions integrations/integration-postgres/makePostgresMetaService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,8 @@ import type {
import {zViewer} from '@usevenice/cdk-core'
import {memoize, R, zFunction} from '@usevenice/util'

import {
applyLimitOffset,
makePostgresClient,
zPgConfig,
} from './makePostgresClient'
import {zPgConfig} from './def'
import {applyLimitOffset, makePostgresClient} from './makePostgresClient'

const getPostgreClient = memoize((databaseUrl: string) =>
makePostgresClient({databaseUrl}),
Expand Down

0 comments on commit 10d885c

Please sign in to comment.