Skip to content

How to configure PostGIS (w/o CGO) #3951

Closed Answered by Nintron27
Nintron27 asked this question in Q&A
Discussion options

You must be logged in to vote

It seems that SQLC wasn't recognizing in my migrations that it was the GEOMETRY type, and that it was nullable. My solution was to change my config to the following:

version: "2"
sql:
  - engine: "postgresql"
    queries: "database/queries"
    schema: "database/migrations"
    gen:
      go:
        package: "gensql"
        out: "database/gensql"
        sql_package: "pgx/v5"
        emit_pointers_for_null_types: true
        emit_json_tags: true
        json_tags_case_style: "camel"
        overrides:
          - db_type: "geometry"
            go_type:
              import: "github.com/cridenour/go-postgis"
              package: "postgis"
              pointer: true
              type: 

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Nintron27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant