go-jet / jet

Type safe SQL builder with code generation and automatic query result data mapping
Apache License 2.0
2.23k stars 110 forks source link

redshift combatibility added to generator #235

Closed stefano-palermo closed 1 year ago

stefano-palermo commented 1 year ago

If you don't like the "SELECT version()" query it can be changed to accept a "redshift" source and pass the isRedshift flag through to GenerateDSN().
This way it's supported through "postgres" source. Whichever is preferable.

go-jet commented 1 year ago

Hi @stefano-palermo, Is the difference between postgres and redshift only in enums support?

stefano-palermo commented 1 year ago

No there's columns missing from the information_schema tables, no LATERAL joins, and a fair amount of functions that are not available in Redshift as well. There's also no generated columns, no constraints (with the exception of NOT NULL), and other differences.

go-jet commented 1 year ago

Aha, I see. What do you think would be the best way to include Redshift into tests, since Redshift is closed source? Using PostgreSQL 8.0.2? Or maybe create Amazon account? Is there is a free tier on Amazon for Redshift?

stefano-palermo commented 1 year ago

Aha, I see. What do you think would be the best way to include Redshift into tests, since Redshift is closed source? Using PostgreSQL 8.0.2? Or maybe create Amazon account? Is there is a free tier on Amazon for Redshift?

This is tricky. There is no free tier, only a 2 month free trial currently. Possibly using Postgres 8 is the best way.

go-jet commented 1 year ago

This is tricky. There is no free tier, only a 2 month free trial currently. Possibly using Postgres 8 is the best way.

If we are going with Postgers 8 for tests, the next step would be to add new docker image. Hopefull we can reuse some of the existing test databases for postgres. It seems that northwind schema doesn't have enums. And then to test redshift we can run only postgres tests that are using northwind schema.

stefano-palermo commented 1 year ago

This is tricky. There is no free tier, only a 2 month free trial currently. Possibly using Postgres 8 is the best way.

If we are going with Postgers 8 for tests, the next step would be to add new docker image. Hopefull we can reuse some of the existing test databases for postgres. It seems that northwind schema doesn't have enums. And then to test redshift we can run only postgres tests that are using northwind schema.

Added an image that attempts to be compatible with Redshift.