Files
upstream-sqlc/internal/endtoend/testdata/vet_explain/mysql/db/models.go
upstream-mirror 0f4df23290
Some checks failed
kotlin / test (push) Has been skipped
python / test (push) Has been skipped
typescript / test (push) Has been skipped
go / build darwin/amd64 (push) Has been cancelled
go / build linux/amd64 (push) Has been cancelled
go / build windows/amd64 (push) Has been cancelled
go / build darwin/arm64 (push) Has been cancelled
go / build linux/arm64 (push) Has been cancelled
go / build windows/arm64 (push) Has been cancelled
go / test (push) Has been cancelled
go / vuln_check (push) Has been cancelled
snapshot of https://github.com/sqlc-dev/sqlc.git (main, 2026-09-16; blobs > 131072B omitted)
2026-09-16 02:17:34 +05:00

138 lines
2.8 KiB
Go

// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.31.1
package test
import (
"database/sql/driver"
"encoding/json"
"fmt"
"time"
)
type DebugCenum string
const (
DebugCenumOne DebugCenum = "one"
DebugCenumTwo DebugCenum = "two"
DebugCenumThree DebugCenum = "three"
)
func (e *DebugCenum) Scan(src any) error {
switch s := src.(type) {
case []byte:
*e = DebugCenum(s)
case string:
*e = DebugCenum(s)
default:
return fmt.Errorf("unsupported scan type for DebugCenum: %T", src)
}
return nil
}
type NullDebugCenum struct {
DebugCenum DebugCenum
Valid bool // Valid is true if DebugCenum is not NULL
}
// Scan implements the Scanner interface.
func (ns *NullDebugCenum) Scan(value any) error {
if value == nil {
ns.DebugCenum, ns.Valid = "", false
return nil
}
ns.Valid = true
return ns.DebugCenum.Scan(value)
}
// Value implements the driver Valuer interface.
func (ns NullDebugCenum) Value() (driver.Value, error) {
if !ns.Valid {
return nil, nil
}
return string(ns.DebugCenum), nil
}
type DebugCset string
const (
DebugCsetOne DebugCset = "one"
DebugCsetTwo DebugCset = "two"
DebugCsetThree DebugCset = "three"
)
func (e *DebugCset) Scan(src any) error {
switch s := src.(type) {
case []byte:
*e = DebugCset(s)
case string:
*e = DebugCset(s)
default:
return fmt.Errorf("unsupported scan type for DebugCset: %T", src)
}
return nil
}
type NullDebugCset struct {
DebugCset DebugCset
Valid bool // Valid is true if DebugCset is not NULL
}
// Scan implements the Scanner interface.
func (ns *NullDebugCset) Scan(value any) error {
if value == nil {
ns.DebugCset, ns.Valid = "", false
return nil
}
ns.Valid = true
return ns.DebugCset.Scan(value)
}
// Value implements the driver Valuer interface.
func (ns NullDebugCset) Value() (driver.Value, error) {
if !ns.Valid {
return nil, nil
}
return string(ns.DebugCset), nil
}
type Debug struct {
ID int64
Csmallint int16
Cint int32
Cinteger int32
Cdecimal string
Cnumeric string
Cfloat float64
Creal float64
Cdoubleprecision float64
Cdouble float64
Cdec string
Cfixed string
Ctinyint int8
Cbool bool
Cmediumint int32
Cbit any
Cdate time.Time
Cdatetime time.Time
Ctimestamp time.Time
Ctime time.Time
Cyear int16
Cchar string
Cvarchar string
Cbinary []byte
Cvarbinary []byte
Ctinyblob []byte
Cblob []byte
Cmediumblob []byte
Clongblob []byte
Ctinytext string
Ctext string
Cmediumtext string
Clongtext string
Cenum NullDebugCenum
Cset DebugCset
Cjson json.RawMessage
}