Files
relspecgo/examples/bun/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

78 lines
3.1 KiB
Go
Executable File

package models_bun
// //ModelCoreProcess - Generated Table for Schema core
// type ModelCoreProcess struct {
// bun.BaseModel `bun:"table:core.process,alias:process"`
// Completedate resolvespec_common.SqlDate `json:"completedate" bun:"completedate,type:date,"`
// Completetime types.CustomIntTime `json:"completetime" bun:"completetime,type:integer,"`
// Description resolvespec_common.SqlString `json:"description" bun:"description,type:citext,"`
// GUID resolvespec_common.SqlUUID `json:"guid" bun:"guid,type:uuid,default:newid(),"`
// Ridcompleteuser resolvespec_common.SqlInt32 `json:"rid_completeuser" bun:"rid_completeuser,type:integer,"`
// Ridhub resolvespec_common.SqlInt32 `json:"rid_hub" bun:"rid_hub,type:integer,"`
// Ridmasterprocess resolvespec_common.SqlInt32 `json:"rid_masterprocess" bun:"rid_masterprocess,type:integer,"`
// Ridprocess resolvespec_common.SqlInt32 `json:"rid_process" bun:"rid_process,type:integer,pk,default:nextval('core.identity_process_rid_process'::regclass),"`
// Status resolvespec_common.SqlString `json:"status" bun:"status,type:citext,"`
// Updatecnt int64 `json:"updatecnt" bun:"updatecnt,type:integer,default:0,"`
// HUB *ModelCoreHub `json:"HUB,omitempty" bun:"rel:has-one,join:rid_hub=rid_hub"`
// MPR *ModelCoreMasterprocess `json:"MPR,omitempty" bun:"rel:has-one,join:rid_masterprocess=rid_masterprocess"`
// TAS []*ModelCoreTasklist `json:"TAS,omitempty" bun:"rel:has-many,join:rid_process=rid_process"`
// db.DBAdhocBuffer `json:",omitempty" bun:",scanonly"`
// db.DBGetIDInterface `json:",omitempty" bun:"-"`
// types.SQLTypable `json:",omitempty" bun:"-"`
// }
// // 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 m.Ridprocess.Int64()
// }
// // 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.FromString(fmt.Sprintf("%d", 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
// }