-
Notifications
You must be signed in to change notification settings - Fork 923
-
Hi, I'm upgrading my project to the versions mentioned in the title. I used to have the following config for sqlc:
version: "2" sql: - schema: "db/migrations" queries: "db/queries" engine: "postgresql" gen: go: sql_package: "pgx/v4" overrides: - db_type: "uuid" go_type: "github.com/google/uuid.UUID" - db_type: "uuid" go_type: "github.com/google/uuid.NullUUID" nullable: true emit_json_tags: true json_tags_case_style: "camel" package: "database" out: "internal/database"
But now with pgx/v5
, I have the following sqlc config:
version: "2" sql: - schema: "db/migrations" queries: "db/queries" engine: "postgresql" gen: go: sql_package: "pgx/v5" emit_json_tags: true json_tags_case_style: "camel" package: "database" out: "internal/database"
Which generates models with pgtype.*
why? it supposes to use sql.*
right?, the problem is that I don't know how to work with pgtype.UUID
to create new random uuid for example, also a lot of refactor needed to accommodate the new pgtype
package. Shall I override the types? In this case, which library should I use? github.com/jackc/pgx-gofrs-uuid
?
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment