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

question(generator): duplicate declaration of UseTypeName #318

Closed yofriadi closed 4 months ago

yofriadi commented 4 months ago

when using UseTypeName for sql builder, it will rename generation of {{tableTemplate.TypeName}} while also renaming {{structImplName}}. this made duplicate of declaration like this:

type myStruct struct {
        // Columns
}

type myStruct struct {
        myStruct

        EXCLUDED myStruct
}

specifically this file_templates.go is there any option to fix this currently?

yofriadi commented 4 months ago

I dig the test cases and found UseTypeName is using utils.ToGoIdentifier(table.Name) then I copy it from the dbidentifier.go since it is from internal folder then all is good.