cli icon indicating copy to clipboard operation
cli copied to clipboard

Generating types with postgis extension lead to file with lint errors.

Open pcardosolei opened this issue 2 years ago • 1 comments

Bug report

Describe the bug

When generating the Database Model via supabase cli if there is an postgis extension activate in its file the functions provided generate errors on the linter.

Screenshot 2022-10-15 at 18 03 27

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  • activate postgis extension on supabase.
  • run supabase gen types typescript

Expected behavior

functions that are more clear on the types.

Screenshots

System information

  • OS: [e.g. macOS, Windows]
  • Browser (if applies) [e.g. chrome, safari]
  • Version of supabase-js: [e.g. 6.0.2]
  • Version of Node.js: [e.g. 10.10.0]

Additional context

Add any other context about the problem here.

pcardosolei avatar Oct 15 '22 17:10 pcardosolei

Thanks for reporting this issue. May I check if you installed postgis in extensions schema or created its own postgis schema?

sweatybridge avatar Oct 16 '22 04:10 sweatybridge

@sweatybridge hey.

Just did this code on tableplus directly.

CREATE EXTENSION postgis;

SELECT AddGeometryColumn ('public','advertisements','geom',4326,'POINT',2);

pcardosolei avatar Oct 16 '22 10:10 pcardosolei

Hey there, we just fixed this on our side - can you try regenerating your types?

Also, you might want to create the extension in the extensions schema instead to not pollute the generated types:

create extension postgis schema extensions;

soedirgo avatar Oct 18 '22 05:10 soedirgo

it is fixed with the latest update.

Will take a look at the comment. Thanks!

pcardosolei avatar Oct 18 '22 09:10 pcardosolei