Skip to content

feat: add additional function create options #131

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 20, 2021
Merged

Conversation

w3b6x9
Copy link
Member

@w3b6x9 w3b6x9 commented Jul 20, 2021

What kind of change does this PR introduce?

feature

What is the new behavior?

Add the following options when creating functions:

  • IMMUTABLE / STABLE / VOLATILE
  • SECURITY INVOKER / SECURITY DEFINER
  • SET configuration_parameter { TO value | = value | FROM CURRENT }

@w3b6x9 w3b6x9 requested a review from soedirgo July 20, 2021 04:31
Copy link
Member

@soedirgo soedirgo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@soedirgo
Copy link
Member

Actually, one sec - wouldn't you want to allow setting multiple configs for config_param and config_values?

@@ -82,21 +82,32 @@ export default class PostgresMetaFunctions {
definition,
rettype = 'void',
language = 'sql',
behavior,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can make VOLATILE the default here instead

}: {
name: string
schema?: string
args?: string[]
definition: string
rettype?: string
language?: string
behavior?: 'IMMUTABLE' | 'STABLE' | 'VOLATILE'
security_definer?: 'false' | 'true'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we make this a boolean instead?

@w3b6x9 w3b6x9 force-pushed the feat/function-options branch from 315ae75 to 934a326 Compare July 20, 2021 07:13
Comment on lines +26 to +32
SELECT
oid as id,
(string_to_array(unnest(proconfig), '='))[1] AS param,
string_to_array((string_to_array(unnest(proconfig), '='))[2], ', ') AS values
FROM
pg_proc
) p_config ON p_config.id = p.oid
Copy link
Member Author

@w3b6x9 w3b6x9 Jul 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@soedirgo not sure why the indentation here is so weird. Looks fine on my local:

Screen Shot 2021-07-20 at 3 14 52 AM

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, looks like some tabs starting from line 27. Not a big deal.

@w3b6x9 w3b6x9 force-pushed the feat/function-options branch from 934a326 to 03ac6d0 Compare July 20, 2021 07:22
@w3b6x9 w3b6x9 merged commit b139fd6 into develop Jul 20, 2021
@w3b6x9 w3b6x9 deleted the feat/function-options branch July 20, 2021 07:24
@github-actions
Copy link

🎉 This PR is included in version 0.22.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

avallete pushed a commit that referenced this pull request May 13, 2025
feat: add additional function create options
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants