Skip to content
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

docs(datatypes): improve details on TEXT #3247

Merged
merged 3 commits into from
Mar 7, 2024
Merged

Conversation

josethz00
Copy link
Contributor

@josethz00 josethz00 commented Mar 5, 2024

This is a small PR on the docs to help the developers to understand how the TEXT datatype works. I struggled a lot trying to override a TEXT column to a string

@josethz00 josethz00 changed the title feat(datatypes): improve details on TEXT docs(datatypes): improve details on TEXT Mar 6, 2024
@kyleconroy
Copy link
Collaborator

This change isn't correct. By default, TEXT columns are mapped to strings. Nullable string are mapped to pgtype.Text when using the pgx/v5 driver. If you want nullable strings to map to *string, you can set emit_pointers_for_null_types.

Full example here https://play.sqlc.dev/p/3f99e092ec2143c1a7b62ef2ea2b037ff31c7c1d11e406d521037367238d8fa9

@josethz00
Copy link
Contributor Author

This change isn't correct. By default, TEXT columns are mapped to strings. Nullable string are mapped to pgtype.Text when using the pgx/v5 driver. If you want nullable strings to map to *string, you can set emit_pointers_for_null_types.

Full example here https://play.sqlc.dev/p/3f99e092ec2143c1a7b62ef2ea2b037ff31c7c1d11e406d521037367238d8fa9

You are correct, my bad. I will change the PR

@kyleconroy kyleconroy merged commit 9f15fae into sqlc-dev:main Mar 7, 2024
8 checks passed
lisitsky pushed a commit to lisitsky/sqlc that referenced this pull request Jun 21, 2024
* feat(datatypes): improve details on TEXT

* docs(datatypes): correct nullable TEXT description

* docs(datatypes): remove incorrect assumption
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