Skip to content

Commit

Permalink
feat(graphile-build-pg): expose more utils (#601)
Browse files Browse the repository at this point in the history
  • Loading branch information
enisdenjo committed Feb 24, 2020
1 parent a9746f1 commit ac74e2d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
16 changes: 16 additions & 0 deletions packages/graphile-build-pg/src/index.d.ts
Expand Up @@ -107,3 +107,19 @@ export {
CursorValue,
CursorComparator,
} from "./QueryBuilder";

export function parseTags(
str: string
): {
tags: { [key: string]: string | string[] | boolean };
text: string;
};

import { Client, Pool } from "pg";
export function withPgClient<T = void>(
pgConfig: Client | Pool | string,
fn: (pgClient: Client) => Promise<T>
): Promise<T>;
export function getPgClientAndReleaserFromConfig(
pgConfig: Client | Pool | string
): Promise<{ pgClient: Client; releasePgClient: () => void }>;
7 changes: 7 additions & 0 deletions packages/graphile-build-pg/src/index.js
Expand Up @@ -123,3 +123,10 @@ export {
};

export { upperFirst, camelCase, constantCase } from "graphile-build";

export { parseTags } from "./utils";

export {
default as withPgClient,
getPgClientAndReleaserFromConfig,
} from "./withPgClient";

0 comments on commit ac74e2d

Please sign in to comment.