question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support SHOW CREATE FUNCTION

See original GitHub issue

Currently, user do not have the ability to see the definition of the SQL functions after they created them. Similar to SHOW CREATE TABLE and SHOW CREATE VIEW, we should also support a similar (though not specified in SQL-standard) syntax for this functionality.

Syntax

For SHOW CREATE TABLE/VIEW, given a fully-qualified name of a table/view, the object is always unique. However, this is not the case for SHOW CREATE FUNCTION as there might be multiple signatures for the same name.

Hence, I’m proposing the following syntax. This is similar to DROP FUNCTION and ALTER FUNCTION where an optional data type list is allowed.

<show create function statement> ::=
    SHOW CREATE <specific routine designator>

<specific routine designator> ::=
    <routine type> <member name>

<routine type> ::=
    FUNCTION

<member name> ::=
    <member name alternatives> [ <data type list> ]

<member name alternatives> ::=
    <schema qualified routine name>

<data type list> ::=
    <left paren> [ <data type> [ { <comma> <data type> }... ] ] <right paren>

Behavior

A SHOW CREATE FUNCTION query outputs one column “Create Function”, the formatted SQL text that would create the exact same function, for each signature that matches what the query specifies.

cc @rongrong @kaikalur

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
caithagorascommented, Jan 16, 2020

@rongrong I cannot find any SHOW CREATE statements being part of SQL-standard, so I believe they’re not.

The parameter list is optional in case user want’s to show a function with the specific signature (for example, might be useful in some automated scripts / pipelines). That being said, SHOW CREATE FUNCTION function_name is a perfectly valid query.

0reactions
caithagorascommented, May 12, 2020
Read more comments on GitHub >

github_iconTop Results From Across the Web

13.7.7.8 SHOW CREATE FUNCTION Statement
This statement is similar to SHOW CREATE PROCEDURE but for stored functions. See Section 13.7.7.9, “SHOW CREATE PROCEDURE Statement”. PREV HOME UP NEXT....
Read more >
SHOW CREATE FUNCTION - MariaDB Knowledge Base
Syntax. SHOW CREATE FUNCTION func_name. Description. This statement is similar to SHOW CREATE PROCEDURE but for stored functions.
Read more >
SHOW CREATE FUNCTION - SingleStore Documentation
Outputs configuration information about an existing user-defined function or procedure, including user-defined scalar value functions (UDFs) ...
Read more >
CREATE FUNCTION | Databricks on AWS
Creates a SQL scalar or table function that takes a set of arguments and returns a scalar value or a set of rows....
Read more >
13.1.17 CREATE PROCEDURE and CREATE FUNCTION ...
The CREATE FUNCTION statement is also used in MySQL to support loadable functions. See Section 13.7.4.1, “CREATE FUNCTION Statement for Loadable Functions”.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found