Skip to content
This repository was archived by the owner on Oct 20, 2025. It is now read-only.

Add support for binding lists, arrays, and structs to prepared queries#423

Merged
taniabogatsch merged 10 commits intomarcboeker:mainfrom
wmTJc9IK0Q:bind-complex-types
Apr 30, 2025
Merged

Add support for binding lists, arrays, and structs to prepared queries#423
taniabogatsch merged 10 commits intomarcboeker:mainfrom
wmTJc9IK0Q:bind-complex-types

Conversation

@wmTJc9IK0Q
Copy link
Copy Markdown
Contributor

Closes #343

I have added support for binding list, array, and struct types to prepared queries.

I have not yet added support for enums (should be achievable, but can be a separate PR). Maps are not possible until duckdb/duckdb#14613 is merged upstream, which seems to be stalled right now.

Open to any feedback to get this merged, thanks.

Copy link
Copy Markdown
Collaborator

@taniabogatsch taniabogatsch left a comment

Choose a reason for hiding this comment

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

Hi, @wmTJc9IK0Q, Thanks for your work on this! I've left some comments :)

Comment thread statement.go Outdated
Comment thread statement.go Outdated
Comment thread statement.go Outdated
Comment thread value.go Outdated
Comment thread types.go
Comment thread types.go Outdated
Comment thread statement.go Outdated
Comment thread statement.go Outdated
Comment thread types.go Outdated
Comment thread types.go Outdated
@taniabogatsch taniabogatsch added feature / enhancement Code improvements or a new feature changes requested Changes have been requested to a PR or issue labels Apr 28, 2025
Copy link
Copy Markdown
Contributor Author

@wmTJc9IK0Q wmTJc9IK0Q left a comment

Choose a reason for hiding this comment

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

@taniabogatsch Thanks for the review. I have addressed most of the feedback. We just need to decide on the path forward on the int casts in value.go

Comment thread value.go Outdated
Copy link
Copy Markdown
Collaborator

@taniabogatsch taniabogatsch left a comment

Choose a reason for hiding this comment

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

Thanks for implementing the review feedback! I just had another pass and only found a few minor things, so I quickly added and pushed them myself.

I've also left a few comments to explain what I did.

What do you think, does this look ready from your side now? :)

Comment thread statement.go Outdated
Comment thread value.go Outdated
Comment thread value.go Outdated
@taniabogatsch taniabogatsch removed the changes requested Changes have been requested to a PR or issue label Apr 30, 2025
@wmTJc9IK0Q
Copy link
Copy Markdown
Contributor Author

@taniabogatsch Thanks for the small fixes. This looks good to me.

@wmTJc9IK0Q
Copy link
Copy Markdown
Contributor Author

I fixed one bug where you could not bind an []any parameter. This is especially important since the library doesn't currently support scanning into a specific slice type. So if you want to use the same type as an argument to a query and to scan into, you need to use []any

@taniabogatsch taniabogatsch merged commit 3c3dc1f into marcboeker:main Apr 30, 2025
31 checks passed
@taniabogatsch
Copy link
Copy Markdown
Collaborator

Thank you! And great catch with the []any parameter! :)

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

Labels

feature / enhancement Code improvements or a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use duckdb_bind_value to bind non-primitive parameters

2 participants