Skip to content

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

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

Open
piyongcai-liucai opened this issue Apr 29, 2025 · 0 comments
Open

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

piyongcai-liucai opened this issue Apr 29, 2025 · 0 comments

Comments

@piyongcai-liucai
Copy link

piyongcai-liucai commented Apr 29, 2025

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

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

No branches or pull requests

1 participant