|
1 | | -import PostgresMeta from "./PostgresMeta.js"; |
2 | | -import { PostgresColumn, PostgresFunction, PostgresMaterializedView, PostgresRelationship, PostgresSchema, PostgresTable, PostgresType, PostgresView } from "./types.js"; |
3 | | -import { PostgresMetaResult } from "./types.js"; |
| 1 | +import PostgresMeta from './PostgresMeta.js' |
| 2 | +import { |
| 3 | + PostgresColumn, |
| 4 | + PostgresFunction, |
| 5 | + PostgresMaterializedView, |
| 6 | + PostgresRelationship, |
| 7 | + PostgresSchema, |
| 8 | + PostgresTable, |
| 9 | + PostgresType, |
| 10 | + PostgresView, |
| 11 | +} from './types.js' |
| 12 | +import { PostgresMetaResult } from './types.js' |
4 | 13 |
|
5 | 14 | export type GeneratorMetadata = { |
6 | | - schemas: PostgresSchema[]; |
7 | | - tables: Omit<PostgresTable, 'columns'>[]; |
8 | | - views: Omit<PostgresView, 'columns'>[]; |
9 | | - materializedViews: Omit<PostgresMaterializedView, 'columns'>[]; |
10 | | - columns: PostgresColumn[]; |
11 | | - relationships: PostgresRelationship[]; |
12 | | - functions: PostgresFunction[]; |
13 | | - types: PostgresType[]; |
14 | | - arrayTypes: PostgresType[]; |
| 15 | + schemas: PostgresSchema[] |
| 16 | + tables: Omit<PostgresTable, 'columns'>[] |
| 17 | + views: Omit<PostgresView, 'columns'>[] |
| 18 | + materializedViews: Omit<PostgresMaterializedView, 'columns'>[] |
| 19 | + columns: PostgresColumn[] |
| 20 | + relationships: PostgresRelationship[] |
| 21 | + functions: PostgresFunction[] |
| 22 | + types: PostgresType[] |
| 23 | + arrayTypes: PostgresType[] |
15 | 24 | } |
16 | 25 |
|
17 | | -export async function getGeneratorMetadata(pgMeta: PostgresMeta, filters: { includedSchemas?: string[]; excludedSchemas?: string[] } = { includedSchemas: [], excludedSchemas: [] }): Promise<PostgresMetaResult<GeneratorMetadata>> { |
| 26 | +export async function getGeneratorMetadata( |
| 27 | + pgMeta: PostgresMeta, |
| 28 | + filters: { includedSchemas?: string[]; excludedSchemas?: string[] } = { |
| 29 | + includedSchemas: [], |
| 30 | + excludedSchemas: [], |
| 31 | + } |
| 32 | +): Promise<PostgresMetaResult<GeneratorMetadata>> { |
18 | 33 | const includedSchemas = filters.includedSchemas ?? [] |
19 | 34 | const excludedSchemas = filters.excludedSchemas ?? [] |
20 | 35 |
|
@@ -90,8 +105,7 @@ export async function getGeneratorMetadata(pgMeta: PostgresMeta, filters: { incl |
90 | 105 | schemas: schemas.filter( |
91 | 106 | ({ name }) => |
92 | 107 | !excludedSchemas.includes(name) && |
93 | | - (includedSchemas.length === 0 || includedSchemas.includes(name) |
94 | | - ) |
| 108 | + (includedSchemas.length === 0 || includedSchemas.includes(name)) |
95 | 109 | ), |
96 | 110 | tables, |
97 | 111 | views, |
|
0 commit comments