Skip to content

Conversation

@davidjb
Copy link
Contributor

@davidjb davidjb commented Jun 12, 2025

In my app, values passed in from JSON (and elsewhere) where they could be a value or NULL in SQL are stored as typed pointers, such as *string. In order to ensure these are handled by sqlitex and bound as BindNull, the nil value needs to be passed as an untyped nil, rather than a *string

This needs to be handled on my side so this PR documents the handling of untyped nil to BindNull in the ExecOptions documentation, alongside how other types are handled.

This also slightly adjusts the default handling documentation, so each section mentions fmt.Sprint(v) and aligns with the implementation (https://github.com/zombiezen/go-sqlite/blob/main/sqlitex/exec.go#L327).

Copy link
Owner

@zombiezen zombiezen left a comment

Choose a reason for hiding this comment

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

Sorry to leave you hanging for so long. I'm not sure how this slipped through the cracks on my end. A few minor tweaks, please:

@davidjb
Copy link
Contributor Author

davidjb commented Jul 2, 2025

Thanks for the review @zombiezen. I've updated the PR and fixed the inconsistent spacing (tabs/spaces). This is what it looks like now when rendered:

rendering of sqlitex docs after formatting changes rendering of sqlitex Exec docs after formatting changes

I updated the fmt.Sprintf references in the type struct comments to match the Exec docs; the latter renders as links but the former doesn't so let me know your thoughts.

Let me know if any thing else needs adjusting.

Copy link
Owner

@zombiezen zombiezen left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks.

@zombiezen zombiezen merged commit 1b2931a into zombiezen:main Jul 2, 2025
5 checks passed
kgrigorev added a commit to kgrigorev/go-sqlite that referenced this pull request Jul 7, 2025
…#122) (#1)

Co-authored-by: David Beitey <david@davidjb.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants