File tree Expand file tree Collapse file tree 3 files changed +7
-10
lines changed Expand file tree Collapse file tree 3 files changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ if (EXPORT_DOCS) {
92
92
GENERATE_TYPES_INCLUDED_SCHEMAS . includes ( name )
93
93
) ,
94
94
tables,
95
- functions,
95
+ functions : functions . filter ( ( f ) => ! [ 'trigger' , 'event_trigger' ] . includes ( f . return_type ) ) ,
96
96
types,
97
97
} )
98
98
)
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ export default async (fastify: FastifyInstance) => {
55
55
( includedSchemas . length === 0 || includedSchemas . includes ( name ) )
56
56
) ,
57
57
tables,
58
- functions,
58
+ functions : functions . filter ( ( f ) => ! [ 'trigger' , 'event_trigger' ] . includes ( f . return_type ) ) ,
59
59
types,
60
60
} )
61
61
} )
Original file line number Diff line number Diff line change @@ -81,18 +81,15 @@ export interface Database {
81
81
}
82
82
Functions: {
83
83
${ functions
84
- . filter (
85
- ( function_ ) =>
86
- function_ . schema === schema . name && function_ . return_type !== 'trigger'
87
- )
84
+ . filter ( ( func ) => func . schema === schema . name )
88
85
. map (
89
- ( function_ ) => `${ JSON . stringify ( function_ . name ) } : {
86
+ ( func ) => `${ JSON . stringify ( func . name ) } : {
90
87
Args: ${ ( ( ) => {
91
- if ( function_ . argument_types === '' ) {
88
+ if ( func . argument_types === '' ) {
92
89
return 'Record<PropertyKey, never>'
93
90
}
94
91
95
- const splitArgs = function_ . argument_types . split ( ',' ) . map ( ( arg ) => arg . trim ( ) )
92
+ const splitArgs = func . argument_types . split ( ',' ) . map ( ( arg ) => arg . trim ( ) )
96
93
if ( splitArgs . some ( ( arg ) => arg . includes ( '"' ) || ! arg . includes ( ' ' ) ) ) {
97
94
return 'Record<string, unknown>'
98
95
}
@@ -110,7 +107,7 @@ export interface Database {
110
107
( { name, type } ) => `${ JSON . stringify ( name ) } : ${ type } `
111
108
) } }`
112
109
} ) ( ) }
113
- Returns: ${ pgTypeToTsType ( function_ . return_type , types ) }
110
+ Returns: ${ pgTypeToTsType ( func . return_type , types ) }
114
111
}`
115
112
) }
116
113
}
You can’t perform that action at this time.
0 commit comments