jet icon indicating copy to clipboard operation
jet copied to clipboard

Inject DB name into model table

Open chaslain opened this issue 10 months ago • 2 comments

The generation feature hard codes the schema name. Suppose I have many schemas with identical data definitions in which I'd like to use the same structs for. Or, suppose the name of my schema is config based.

Perhaps allowing injection of an existing sql.DB somewhere in the process could permit this, with a different generation flag to permit this.

chaslain avatar Jan 30 '25 19:01 chaslain

Generator customization might be what you are looking for - https://github.com/go-jet/jet/wiki/Generator#generator-customization.

trevlt avatar Jan 31 '25 10:01 trevlt

Maybe table.UseSchema("schemaName") is what you need

https://github.com/go-jet/jet/wiki/FAQ#how-to-use-jet-in-multi-tenant-environment

VolkerLieber avatar Mar 05 '25 20:03 VolkerLieber