techrail / ground

The ground setup for building go based services (web or otherwise)
MIT License
1 stars 5 forks source link

Code Generator: Single schema code generation #9

Open vaibhav-kaushal opened 9 months ago

vaibhav-kaushal commented 9 months ago

Right now, the code generator will create SQL queries which contain the schema name in front of the table name. Like this:

SELECT * FROM "public.users" WHERE "email" = $1

This looks ugly when there is just one schema in the database, which would usually be the case. We have to create the option to generate SQL queries without the schema name in front of tables when only one schema is present so that the query looks more like:

SELECT * FROM "users" WHERE "email" = $1
bhagatvansh commented 8 months ago

Working on this