We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This is the table
CREATE TABLE "t_foo" ( "a" INTEGER NOT NULL, "b" TEXT NOT NULL, "name" TEXT )
Here is the struct
struct
type Foo struct { A uint64 `db:"a"` B string `db:"b"` Name string `db:"name"` }
It's setup like this:
dbmap.AddTableWithName(Foo{}, "t_foo").SetKeys(false, "a", "b")
The select works just fine
foo := Foo{} err = dbm.SelectOne(&foo, "select * from t_foo where a=? and b=? limit 1", 1, "xyz", )
but when I then do an update
_, err = dbm.Update(&foo) if err != nil { ... }
I am getting an error no table found for type: .
no table found for type:
I tried to turn on the logging but I didn't even see the update statement.
dbmap.TraceOn("[gorp]", log.New(os.Stdout, "indie:", log.Lmicroseconds))
Turns out the problem was super simple: foo was already a reference and not a value.
Is there any way to improve the error message?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
This is the table
Here is the
struct
It's setup like this:
The select works just fine
but when I then do an update
I am getting an error
no table found for type:
.I tried to turn on the logging but I didn't even see the update statement.
Turns out the problem was super simple: foo was already a reference and not a value.
Is there any way to improve the error message?
The text was updated successfully, but these errors were encountered: