Hello and thanks for your time to check this issue
If you're having a generation problem please answer these questions before submitting your issue. Thanks!
What version of SQLBoiler are you using (sqlboiler --version)?
2.5.1
If this happened at generation time what was the full SQLBoiler command you used to generate your models? (if not applicable leave blank)
If this happened at runtime what code produced the issue? (if not applicable leave blank)
Definition of container..
type Container struct {
ContainerID uint `boil:"container_id" json:"container_id" toml:"container_id" yaml:"container_id"`
ContainerType null.String `boil:"container_type" json:"container_type,omitempty" toml:"container_type" yaml:"container_type,omitempty"`
ContainerWeight null.Uint32 `boil:"container_weight" json:"container_weight,omitempty" toml:"container_weight" yaml:"container_weight,omitempty"`
ContainerVol null.Uint32 `boil:"container_vol" json:"container_vol,omitempty" toml:"container_vol" yaml:"container_vol,omitempty"`
ContainerNum null.Uint16 `boil:"container_num" json:"container_num,omitempty" toml:"container_num" yaml:"container_num,omitempty"`
RFQID uint `boil:"rfq_id" json:"rfq_id" toml:"rfq_id" yaml:"rfq_id"`
R *containerR `boil:"-" json:"-" toml:"-" yaml:"-"`
L containerL `boil:"-" json:"-" toml:"-" yaml:"-"`
}
//Actual code
container:= models.Container{
ContainerType: StringFrom("40ft"),
ContainerWeight: Uint32From(10000), *
ContainerVol:Uint32From(100) ,
ContainerNum: Uint16From(2),
RFQID:4 ,
}
if err:= container.Insert(db); err != nil {
fmt.Fprintf(boil.DebugWriter,"%s\n", err)
if driverErr, ok := err.(*mysql.MySQLError); ok { // Now the error number is accessible directly
fmt.Fprintf(boil.DebugWriter,"%v, %s\n", driverErr.Number, driverErr.Message)
}
}
What is the output of the command above with the -d flag added to it? (Provided you are comfortable sharing this, it contains a blueprint of your schema)
INSERT INTO containers (container_type,container_weight,container_vol,container_num,rfq_id) VALUES (?,?,?,?,?)
[{40ft true} {10000 true} {100 true} {2 true} 4]
models: unable to insert into containers: sql: converting Exec argument $2 type: non-Value type uint64 returned from Value
Please provide a relevant database schema so we can replicate your issue (Provided you are comfortable sharing this)
Hello and thanks for your time to check this issue
If you're having a generation problem please answer these questions before submitting your issue. Thanks!
What version of SQLBoiler are you using (
sqlboiler --version
)?2.5.1
If this happened at generation time what was the full SQLBoiler command you used to generate your models? (if not applicable leave blank)
If this happened at runtime what code produced the issue? (if not applicable leave blank)
Definition of container..
What is the output of the command above with the
-d
flag added to it? (Provided you are comfortable sharing this, it contains a blueprint of your schema)Please provide a relevant database schema so we can replicate your issue (Provided you are comfortable sharing this)
Further information. What did you do, what did you expect?
I was trying to insert this struct in the database.
Is it any problem with MEDIUMINT or SMALLINT binding? Thank you in advance, Dimitris