Files
relspecgo/examples/gorm/sql_core_process.go
Hein 5d60bc3b2c
Some checks are pending
CI / Test (1.23) (push) Waiting to run
CI / Test (1.24) (push) Waiting to run
CI / Test (1.25) (push) Waiting to run
CI / Lint (push) Waiting to run
CI / Build (push) Waiting to run
Bugs Fixed
1. pkg/models/models.go:184 - Fixed typo in ForeignKeyConstraint constant from "foreign_Key" to "foreign_key"
  2. pkg/readers/drawdb/reader.go:62-68 - Fixed ReadSchema() to properly detect schema name from tables instead of hardcoding "default"
  3. pkg/writers/dbml/writer.go:128 - Changed primary key attribute from "primary key" to DBML standard "pk"
  4. pkg/writers/dbml/writer.go:208-221 - Fixed foreign key reference format to use "table.column" syntax for single columns instead of "table.(column)"

  Test Results

  All reader and writer tests are now passing:

  Readers:
  - DBML: 74.4% coverage (2 tests skipped due to missing parser features for Ref statements)
  - DCTX: 77.6% coverage
  - DrawDB: 83.6% coverage
  - JSON: 82.1% coverage
  - YAML: 82.1% coverage

  Writers:
  - Bun: 68.5% coverage
  - DBML: 91.5% coverage
  - DCTX: 100.0% coverage
  - DrawDB: 83.8% coverage
  - GORM: 69.2% coverage
  - JSON: 82.4% coverage
  - YAML: 82.4% coverage
2025-12-16 21:43:45 +02:00

77 lines
3.1 KiB
Go
Executable File

package models
// //ModelCoreProcess - Generated Table for Schema core
// type ModelCoreProcess struct {
// Completedate types.CustomDate `json:"completedate" gorm:"Column:completedate;type:date;"`
// Completetime types.CustomIntTime `json:"completetime" gorm:"Column:completetime;type:integer;"`
// Description string `json:"description" gorm:"Column:description;type:citext;"`
// GUID types.NullableUUID `json:"guid" gorm:"Column:guid;type:uuid;default:newid();"`
// Ridcompleteuser types.ZNullInt32 `json:"rid_completeuser" gorm:"Column:rid_completeuser;type:integer;"`
// Ridhub types.ZNullInt32 `json:"rid_hub" gorm:"Column:rid_hub;type:integer;"`
// Ridmasterprocess types.ZNullInt32 `json:"rid_masterprocess" gorm:"Column:rid_masterprocess;type:integer;"`
// Ridprocess int32 `json:"rid_process" gorm:"Column:rid_process;type:integer;primaryKey;default:nextval('core.identity_process_rid_process'::regclass);"`
// Status string `json:"status" gorm:"Column:status;type:citext;"`
// Updatecnt int64 `json:"updatecnt" gorm:"Column:updatecnt;type:integer;default:0;"`
// HUB *ModelCoreHub `json:"HUB,omitempty" gorm:"references:rid_hub;foreignKey:rid_hub;"`
// MPR *ModelCoreMasterprocess `json:"MPR,omitempty" gorm:"references:rid_masterprocess;foreignKey:rid_masterprocess;"`
// TAS []*ModelCoreTasklist `json:"TAS,omitempty" gorm:"references:rid_process;foreignKey:rid_process;opt_c"`
// db.DBAdhocBuffer `json:",omitempty"`
// db.DBGetIDInterface `json:",omitempty" gorm:"-"`
// types.SQLTypable `json:",omitempty" gorm:"-"`
// }
// // TableName - Returns the table name for the object.
// func (m ModelCoreProcess) TableName() string {
// return "core.process"
// }
// // TableName - Returns the table name for the object.
// func (m ModelCoreProcess) TableNameOnly() string {
// return "process"
// }
// // SchemaName - Returns the schema name for the object.
// func (m ModelCoreProcess) SchemaName() string {
// return "core"
// }
// // GetID - ID interface
// func (m ModelCoreProcess) GetID() int64 {
// return int64(m.Ridprocess)
// }
// // GetIDStr - ID interface
// func (m ModelCoreProcess) GetIDStr() string {
// return fmt.Sprintf("%d", m.Ridprocess)
// }
// // SetID - ID interface
// func (m ModelCoreProcess) SetID(newid int64) {
// m.UpdateID(newid)
// }
// func (m *ModelCoreProcess) UpdateID(newid int64) {
// m.Ridprocess = int32(newid)
// }
// // GetIDName - ID interface
// func (m ModelCoreProcess) GetIDName() string {
// return "rid_process"
// }
// // GetPrefix - Returns a table prefix
// func (m ModelCoreProcess) GetPrefix() string {
// return "PRO"
// }
// // GetRowNumber - Returns the row number of the record
// func (m ModelCoreProcess) GetRowNumber() int64 {
// return m.RowNumber
// }
// // SetRowNumber - Set the row number of a record
// func (m *ModelCoreProcess) SetRowNumber(num int64) {
// m.RowNumber = num
// }