File tree Expand file tree Collapse file tree 4 files changed +27
-8
lines changed Expand file tree Collapse file tree 4 files changed +27
-8
lines changed Original file line number Diff line number Diff line change @@ -357,6 +357,8 @@ export interface Database {
357357 } ) ( ) } )${ is_set_returning_function ? '[]' : '' }
358358 }`
359359 )
360+ // We only sorted by name on schemaFunctions - here we sort by arg names, arg types, and return type.
361+ . sort ( )
360362 . join ( '|' ) } `
361363 )
362364 } ) ( ) }
Original file line number Diff line number Diff line change 9393as $$
9494 select id, name from public .users ;
9595$$;
96+
97+ create or replace function public .polymorphic_function(text ) returns void language sql as ' ' ;
98+ create or replace function public .polymorphic_function(bool) returns void language sql as ' ' ;
Original file line number Diff line number Diff line change @@ -3,14 +3,15 @@ import { app } from './utils'
33
44test ( 'list column privileges' , async ( ) => {
55 const res = await app . inject ( { method : 'GET' , path : '/column-privileges' } )
6- expect (
7- res
8- . json < PostgresColumnPrivileges [ ] > ( )
9- . find (
10- ( { relation_schema, relation_name, column_name } ) =>
11- relation_schema === 'public' && relation_name === 'todos' && column_name === 'id'
12- )
13- ) . toMatchInlineSnapshot (
6+ const column = res
7+ . json < PostgresColumnPrivileges [ ] > ( )
8+ . find (
9+ ( { relation_schema, relation_name, column_name } ) =>
10+ relation_schema === 'public' && relation_name === 'todos' && column_name === 'id'
11+ ) !
12+ // We don't guarantee order of privileges, but we want to keep the snapshots consistent.
13+ column . privileges . sort ( ( a , b ) => JSON . stringify ( a ) . localeCompare ( JSON . stringify ( b ) ) )
14+ expect ( column ) . toMatchInlineSnapshot (
1415 { column_id : expect . stringMatching ( / ^ \d + \. \d + $ / ) } ,
1516 `
1617 {
Original file line number Diff line number Diff line change @@ -240,6 +240,19 @@ test('typegen', async () => {
240240 name: string
241241 }[]
242242 }
243+ polymorphic_function:
244+ | {
245+ Args: {
246+ "": boolean
247+ }
248+ Returns: undefined
249+ }
250+ | {
251+ Args: {
252+ "": string
253+ }
254+ Returns: undefined
255+ }
243256 postgres_fdw_disconnect: {
244257 Args: {
245258 "": string
You can’t perform that action at this time.
0 commit comments