Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions graphql/server/__tests__/schema.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import express from 'express';
import { postgraphile } from 'postgraphile';
// @ts-ignore
import { getGraphileSettings } from 'graphile-settings';
import { getPgPool } from 'pg-cache';
import { close as closePgPools, getPgPool } from 'pg-cache';

import { buildSchemaSDL, fetchEndpointSchemaSDL } from '../src/schema';
import { seed, getConnections } from 'graphile-test';

jest.setTimeout(30000);

const schemas = ['app_public'];
const sql = (f: string) => join(__dirname, '../../@constructive-io/graphql-test/sql', f);
const sql = (f: string) => join(__dirname, '../../test/sql', f);

let db: any;
let teardown: () => Promise<void>;
Expand All @@ -38,6 +38,7 @@ afterAll(async () => {
server = null;
}
await teardown();
await closePgPools();
});

beforeEach(async () => {
Expand Down Expand Up @@ -90,4 +91,4 @@ it('fetchEndpointSchemaSDL returns the same SDL as buildSchemaSDL for a running

// The SDL generated directly from the database should match the one from HTTP introspection
expect(sdlViaHTTP).toBe(sdlDirect);
});
});
1 change: 0 additions & 1 deletion jobs/job-utils/src/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export const getJobPgConfig = (): PgConfig => {
return {
...defaultPgConfig,
...(opts.pg ?? {}),
...(opts.jobs?.pg ?? {}),
...envOnly
};
};
Expand Down
34 changes: 2 additions & 32 deletions pgpm/types/src/jobs.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
import { PgConfig } from 'pg-env';

/**
* Job system PostgreSQL configuration
* Extends the base PgConfig with job-specific database settings
*/
export interface JobPgConfig extends PgConfig {
/** Database name for job system (defaults to 'jobs') */
database: string;
}

/**
* Job schema configuration
*/
Expand Down Expand Up @@ -155,7 +144,7 @@ export interface Job {
/**
* Worker configuration options
*/
export interface JobWorkerConfig extends JobPgConfig, JobSchemaConfig, JobHostnameConfig, JobTaskSupportConfig {
export interface JobWorkerConfig extends JobSchemaConfig, JobHostnameConfig, JobTaskSupportConfig {
/** Polling interval in milliseconds */
pollInterval?: number;
/** Whether to enable graceful shutdown */
Expand All @@ -165,7 +154,7 @@ export interface JobWorkerConfig extends JobPgConfig, JobSchemaConfig, JobHostna
/**
* Scheduler configuration options
*/
export interface JobSchedulerConfig extends JobPgConfig, JobSchemaConfig, JobHostnameConfig, JobTaskSupportConfig {
export interface JobSchedulerConfig extends JobSchemaConfig, JobHostnameConfig, JobTaskSupportConfig {
/** Polling interval in milliseconds for checking scheduled jobs */
pollInterval?: number;
/** Whether to enable graceful shutdown */
Expand All @@ -176,8 +165,6 @@ export interface JobSchedulerConfig extends JobPgConfig, JobSchemaConfig, JobHos
* Complete job system configuration
*/
export interface JobsConfig {
/** PostgreSQL database configuration */
pg?: Partial<JobPgConfig>;
/** Job schema configuration */
schema?: Partial<JobSchemaConfig>;
/** Worker configuration */
Expand All @@ -192,22 +179,10 @@ export interface JobsConfig {
* Default configuration values for job system
*/
export const jobsDefaults: JobsConfig = {
pg: {
host: 'localhost',
port: 5432,
user: 'postgres',
password: 'password',
database: 'jobs'
},
schema: {
schema: 'app_jobs'
},
worker: {
host: 'localhost',
port: 5432,
user: 'postgres',
password: 'password',
database: 'jobs',
schema: 'app_jobs',
hostname: 'worker-0',
supportAny: true,
Expand All @@ -216,11 +191,6 @@ export const jobsDefaults: JobsConfig = {
gracefulShutdown: true
},
scheduler: {
host: 'localhost',
port: 5432,
user: 'postgres',
password: 'password',
database: 'jobs',
schema: 'app_jobs',
hostname: 'scheduler-0',
supportAny: true,
Expand Down
17 changes: 0 additions & 17 deletions pgpm/types/src/pgpm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,22 +261,10 @@ export const pgpmDefaults: PgpmOptions = {
}
},
jobs: {
pg: {
host: 'localhost',
port: 5432,
user: 'postgres',
password: 'password',
database: 'jobs'
},
schema: {
schema: 'app_jobs'
},
worker: {
host: 'localhost',
port: 5432,
user: 'postgres',
password: 'password',
database: 'jobs',
schema: 'app_jobs',
hostname: 'worker-0',
supportAny: true,
Expand All @@ -285,11 +273,6 @@ export const pgpmDefaults: PgpmOptions = {
gracefulShutdown: true
},
scheduler: {
host: 'localhost',
port: 5432,
user: 'postgres',
password: 'password',
database: 'jobs',
schema: 'app_jobs',
hostname: 'scheduler-0',
supportAny: true,
Expand Down