feat: import Ref current-season comparison fixture

This commit is contained in:
2026-08-02 15:39:06 +00:00
parent 2f17584075
commit a061297a3f
7 changed files with 1119 additions and 8 deletions
+11 -3
View File
@@ -26,12 +26,20 @@ const quoteIdentifier = (value: string): string => {
export const createMariaPool = (uri: string): MariaPool => mariadb.createPool(uri);
export const createPostgresPool = (connectionString: string): pg.Pool =>
new pg.Pool({
connectionString,
export const createPostgresPool = (connectionString: string): pg.Pool => {
const url = new URL(connectionString);
const schema = url.searchParams.get('schema');
if (schema && !IDENTIFIER.test(schema)) {
throw new Error(`Unsafe PostgreSQL schema: ${schema}`);
}
url.searchParams.delete('schema');
return new pg.Pool({
connectionString: url.toString(),
max: 2,
application_name: 'sammo-legacy-db-migration',
...(schema ? { options: `-c search_path=${schema}` } : {}),
});
};
const isSourceRow = (value: unknown): value is SourceRow =>
value !== null && !Array.isArray(value) && typeof value === 'object';