Open alidevhere opened 1 year ago
NamingStrategy.IdentifierMaxLength has been added in gorm, which allows to override max length of 64. How to make use of this in postgres driver to change it to 63. @jinzhu i can only think of it like this :
import ( "gorm.io/driver/postgres" "gorm.io/gorm" s "gorm.io/gorm/schema" ) func main() { db, err := gorm.Open(postgres.New(postgres.Config{ DSN: "host=localhost user=gorm password=gorm dbname=gorm port=9920 sslmode=disable TimeZone=Asia/Shanghai", // data source name, refer https://github.com/jackc/pgx PreferSimpleProtocol: true, // disables implicit prepared statement usage. By default pgx automatically uses the extended protocol }), &gorm.Config{NamingStrategy: s.NamingStrategy{IdentifierMaxLength: 63}}) }
And please assign this issue to me, i will work on it commited change in gorm
like other drivers https://github.com/go-gorm/mysql/blob/master/mysql.go#L100
@jinzhu @a631807682 pull request is created for this issue
@jinzhu @a631807682
PR created for this issue
Describe the feature
NamingStrategy.IdentifierMaxLength has been added in gorm, which allows to override max length of 64. How to make use of this in postgres driver to change it to 63. @jinzhu i can only think of it like this :
Related Issues
And please assign this issue to me, i will work on it commited change in gorm