stephenafamo / bob

SQL query builder and ORM/Factory generator for Go with support for PostgreSQL, MySQL and SQLite
https://bob.stephenafamo.com
MIT License
701 stars 37 forks source link

enums naming generation bug #216

Closed atzedus closed 1 month ago

atzedus commented 1 month ago

1) init database:

CREATE TYPE platform AS ENUM ('DESKTOP', 'MOBILE', 'SMART_TV');

2) generate code by bob v0.26.0

Expected:

// Enum values for Platform
const (
    PlatformDESKTOP    Platform = "DESKTOP"
    PlatformMOBILE     Platform = "MOBILE"
    PlatformSMART_TV Platform = "SMART_TV"
)

result:

// Enum values for Platform
const (
    PlatformDESKTOP    Platform = "DESKTOP"
    PlatformMOBILE     Platform = "MOBILE"
    PlatformSMARTU5fTV Platform = "SMART_TV"
)

PlatformSMARTU5fTV

stephenafamo commented 1 month ago

A side effect of better support for symbols 😅

I'll fix this soon

stephenafamo commented 1 month ago

Should be fixed in #218.

Try it out and let me know.