Skip to content
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

Add .parse_plpgsql method to parse PL/pgSQL function definitions #316

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lfittl
Copy link
Member

@lfittl lfittl commented May 17, 2024

This uses Postgres' PL/pgSQL parser (as extracted in libpg_query) to parse a PL/pgSQL CREATE FUNCTION statement into the AST.

TODO

  • Add a test showing an example

This uses Postgres' PL/pgSQL parser (as extracted in libpg_query)
to parse a PL/pgSQL CREATE FUNCTION statement into the AST.
@@ -0,0 +1,43 @@
require 'json'
module PgQuery
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
module PgQuery
module PgQuery

module PgQuery
class PlpgsqlParseError < ArgumentError
attr_reader :location
def initialize(message, source_file, source_line, location)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
def initialize(message, source_file, source_line, location)
def initialize(message, source_file, source_line, location)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants