jschaf / pggen

Generate type-safe Go for any Postgres query. If Postgres can run the query, pggen can generate code for it.
MIT License
282 stars 26 forks source link

Add non-nullability support for LIMIT queries #50

Closed djsavvy closed 2 years ago

djsavvy commented 2 years ago

Currently, a simple query with a LIMIT clause appended makes all the fields returned nullable. As far as I can tell from the postgres documentation, LIMIT never makes a non-nullable column nullable (this matches intuition as well). Therefore, this should be safe to merge without breaking any functionality.