Skip to content

Commit b0a0bff

Browse files
authored
feat: update function option rettype to return_type (#133)
1 parent b139fd6 commit b0a0bff

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/lib/PostgresMetaFunctions.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export default class PostgresMetaFunctions {
8080
schema = 'public',
8181
args = [],
8282
definition,
83-
rettype = 'void',
83+
return_type = 'void',
8484
language = 'sql',
8585
behavior = 'VOLATILE',
8686
security_definer = false,
@@ -90,15 +90,15 @@ export default class PostgresMetaFunctions {
9090
schema?: string
9191
args?: string[]
9292
definition: string
93-
rettype?: string
93+
return_type?: string
9494
language?: string
9595
behavior?: 'IMMUTABLE' | 'STABLE' | 'VOLATILE'
9696
security_definer?: boolean
9797
config_params: { [key: string]: string[] }
9898
}): Promise<PostgresMetaResult<PostgresFunction>> {
9999
const sql = `
100100
CREATE FUNCTION ${ident(schema)}.${ident(name)}(${args.join(', ')})
101-
RETURNS ${rettype}
101+
RETURNS ${return_type}
102102
AS ${literal(definition)}
103103
LANGUAGE ${language}
104104
${behavior}

test/integration/index.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ describe('/functions', () => {
163163
schema: 'public',
164164
args: ['integer', 'integer'],
165165
definition: 'select $1 + $2',
166-
rettype: 'integer',
166+
return_type: 'integer',
167167
language: 'sql',
168168
behavior: 'STABLE',
169169
security_definer: true,

0 commit comments

Comments
 (0)