Skip to content

Proposal to improve some existing features #2672

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

Closed
KevenGoncalves opened this issue Aug 29, 2023 · 2 comments
Closed

Proposal to improve some existing features #2672

KevenGoncalves opened this issue Aug 29, 2023 · 2 comments
Labels
enhancement New feature or request triage New issues that hasn't been reviewed

Comments

@KevenGoncalves
Copy link

KevenGoncalves commented Aug 29, 2023

What do you want to change?

SQLC

Sqlc is a very good package, one of the best in go-lang world but it's lacks some features:

Dynamic query ( mainly for where, and order by)

We have some work around using when and case but it's not viable implementation and it's not documented, so the dev need to spend most of time figuring it out how to implement and in worst case you should write one more then 1 query just for the same thing, something like sqlc.where() and sqlc.orderBy() would be amazing

Slices for embed structs

Right now you only can just generate a struct not a slice of struct with slqc.embed(), would be amazing to group all structs in a slice when the id is the same for a join

Lack of functionality in sqlc.embed()

The slqc.embed() is a very good feature but have some problems: when a relation return null the queries return an error, and the sqlc.embed() doesn't support to choice which fields need to be returned from the table we want to select
something like sqlc.nembed() to allow null like sqlc.narg() would be awesome and sqlc.embed(table_1,(id, name))

Taking in consideration:
#2472
#2343
#2643

What database engines need to be changed?

PostgreSQL

What programming language backends need to be changed?

Go

@KevenGoncalves KevenGoncalves added enhancement New feature or request triage New issues that hasn't been reviewed labels Aug 29, 2023
@kyleconroy
Copy link
Collaborator

Appreciate the feature requests.

For dynamic query support, please follow along on #2061 and #2060.

Grouping all embedded structs into a slice is currently beyond what we intended when designing sqlc.slice. Follow #2794 and #2760 for future workarounds.

@kyleconroy
Copy link
Collaborator

Actually tracking JSON here #2761

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request triage New issues that hasn't been reviewed
Projects
None yet
Development

No branches or pull requests

2 participants