Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

allow renaming function Params structs#3878

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
skandragon wants to merge3 commits intosqlc-dev:main
base:main
Choose a base branch
Loading
fromskandragon:rename-params

Conversation

skandragon
Copy link

I have a case where I want to wrap some of the database calls in some internal layers, and would like to have a single params structure that is exposed between my hand-rolled wrapped code and the generated names.

Specifically, I am making a function calledUpsertFooUncached using code gen and I want a cached version:

func (q*Queries)UpsertFoo(ctx context.Context,argsUpsertFooParams) (uuid.UUID,error) {// caching would go hereid,err:=q.UpsertFooUncached(ctx,args)iferr!=nil {returnuuid.Nil,err  }// cache the resultreturnid,nil}

In this case, I could usetype UpsertFooParams UpsertFooUncachedParams but this doesn't work well for users as it doesn't always expand with VSCode, so the internals are a mystery. I could recreate the structure, but then I need to keep it in sync. I could embed the Uncached version, but then using it is a pain.

I'd like to rename, and this change seems to do the trick.

narma reacted with thumbs up emoji
@dosubotdosubotbot added size:XSThis PR changes 0-9 lines, ignoring generated files. 🔧 golang size:MThis PR changes 30-99 lines, ignoring generated files. and removed size:XSThis PR changes 0-9 lines, ignoring generated files. labelsMar 11, 2025
@skandragon
Copy link
Author

Any chance this can be merged, or feedback on what it would take?

@skandragon
Copy link
Author

bump.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
size:MThis PR changes 30-99 lines, ignoring generated files.🔧 golang
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

1 participant
@skandragon

[8]ページ先頭

©2009-2025 Movatter.jp