@openstax/ts-utils 1.21.0 → 1.21.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/services/postgresConnection/index.d.ts +3 -3
- package/dist/cjs/services/postgresConnection/index.js +3 -3
- package/dist/cjs/tsconfig.without-specs.cjs.tsbuildinfo +1 -1
- package/dist/esm/services/postgresConnection/index.d.ts +3 -3
- package/dist/esm/services/postgresConnection/index.js +3 -3
- package/dist/esm/tsconfig.without-specs.esm.tsbuildinfo +1 -1
- package/package.json +6 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ConfigProviderForConfig } from '../../config';
|
|
2
1
|
import postgres, { Sql } from 'postgres';
|
|
3
|
-
import
|
|
2
|
+
import { ConfigProviderForConfig } from '../../config';
|
|
3
|
+
import type { Logger } from '../logger';
|
|
4
4
|
declare type Config = {
|
|
5
5
|
host: string;
|
|
6
6
|
readHost: string;
|
|
@@ -28,7 +28,7 @@ export declare const postgresConnection: <C extends string = "local">(initialize
|
|
|
28
28
|
down: () => Promise<void[]>;
|
|
29
29
|
};
|
|
30
30
|
export declare type PostgresConnection = ReturnType<ReturnType<ReturnType<typeof postgresConnection>>>;
|
|
31
|
-
interface Migration {
|
|
31
|
+
export interface Migration {
|
|
32
32
|
name: string;
|
|
33
33
|
up: (db: Sql) => Promise<void>;
|
|
34
34
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import postgres from 'postgres';
|
|
2
|
+
import { assertNotNaN } from '../../assertions';
|
|
2
3
|
import { resolveConfigValue } from '../../config';
|
|
3
4
|
import { ifDefined } from '../../guards';
|
|
4
|
-
import {
|
|
5
|
-
import postgres from 'postgres';
|
|
5
|
+
import { once } from '../../misc/helpers';
|
|
6
6
|
export const postgresConnection = (initializer) => (configProvider) => {
|
|
7
7
|
const config = configProvider[ifDefined(initializer.configSpace, 'local')];
|
|
8
8
|
const host = once(() => resolveConfigValue(config.host));
|