Skip to content

postgresql "DO $$ BEGIN", not generate parameter. #3949

Open
@piyongcai-liucai

Description

@piyongcai-liucai

What do you want to change?

query

DO $$ BEGIN
  DELETE
    FROM stage_seat
  WHERE stage_id = $1;     -- <--- HERE has parameter

  -- other sql 
END $$;

query

const resetStagePlace = `-- name: ResetStagePlace :exec
DO $$ BEGIN
  DELETE
    FROM stage_seat
  WHERE stage_id = $1;
END $$
`
//	DO $$ BEGIN
//	  DELETE
//	    FROM stage_seat
//	  WHERE stage_id = $1; -- <--- HERE has parameter
//  
//       -- other sql 
//	END $$
func (q *Queries) ResetStagePlace(ctx context.Context) error {   // <-- HERE, not generate parameter
	_, err := q.db.Exec(ctx, resetStagePlace)
	return err
}

feature request:
generate parameter for "DO $$ BEGIN ... END $$".

What database engines need to be changed?

PostgreSQL

What programming language backends need to be changed?

Go

Activity

DanielRasho

DanielRasho commented on May 15, 2025

@DanielRasho

Same problem here

esc20936

esc20936 commented on May 15, 2025

@esc20936

Having the same issue here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @esc20936@DanielRasho@piyongcai-liucai

        Issue actions

          postgresql "DO $$ BEGIN", not generate parameter. · Issue #3949 · sqlc-dev/sqlc