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

Code Generator Bug, Special Char in Enum Name #196

Closed safaci2000 closed 3 months ago

safaci2000 commented 3 months ago

related raw SQL:

CREATE TYPE tasks.task_type AS ENUM ('S3:INIT', 'PCAP:MERGE' );
   2031 bytes        internal/dbmodels/bobs/bob_enums.go
2024/03/19 21:50:22 singleton template output: failed to format template

  78 
  79    type TasksTaskType string
  80 
  81    // Enum values for TasksTaskType
  82    const (
>>>>    TasksTaskTypeS3:INIT TasksTaskType = "S3:INIT"
  84            TasksTaskTypePCAP:MERGE TasksTaskType = "PCAP:MERGE"
  85            TasksTaskTypeCTRL:SUBMIT TasksTaskType = "CTRL:SUBMIT"
  86            TasksTaskTypeCTRL:STOP TasksTaskType = "CTRL:STOP"
  87            )
  88 
psql:
  dsn: "postgres://ht_controller_user:secret@127.0.0.1:5432/funcap_controller?sslmode=disable"
  tags:
    - "db"
    - "json"
  wire: true
  struct_tag_casing: snake
  pkgname: "bobs"
  output: "internal/dbmodels/bobs"
  schemas: 
    - funcap
    - storage
    - tasks
    - audit
safaci2000 commented 3 months ago

this is a duplicate of https://github.com/stephenafamo/bob/issues/181. I'm l'll close this out.