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
v2.6.3
There is a unique index in the table of PgSQL, WherePri identify probably an error primary key.
Please put the code in contrib/drivers/pgsql/pgsql_z_unit_model_test.go. In the way, you can debug it directly.
contrib/drivers/pgsql/pgsql_z_unit_model_test.go
func Test_Model_WherePri(t *testing.T) { var ( table = fmt.Sprintf(`%s_%d`, TablePrefix+"test", gtime.TimestampNano()) uniqueName = fmt.Sprintf(`%s_%d`, TablePrefix+"test_unique", gtime.TimestampNano()) ) if _, err := db.Exec(ctx, fmt.Sprintf(` CREATE TABLE %s ( id bigserial NOT NULL, passport varchar(45) NOT NULL, password varchar(32) NOT NULL, nickname varchar(45) NOT NULL, create_time timestamp NOT NULL, PRIMARY KEY (id), CONSTRAINT %s unique ("password") ) ;`, table, uniqueName, )); err != nil { gtest.Fatal(err) } defer dropTable(table) gtest.C(t, func(t *gtest.T) { data := g.Map{ "id": 1, "passport": "pp1", "password": "pw1", "nickname": "n1", "create_time": "2016-06-06", } _, err := db.Model(table).Data(data).Insert() t.AssertNil(err) one, err := db.Model(table).WherePri(1).One() t.AssertNil(err) t.Assert(one["passport"], data["passport"]) t.Assert(one["password"], data["password"]) t.Assert(one["nickname"], "n1") }) }
Probably , it will fail.
[ASSERT] EXPECT == pp1
The text was updated successfully, but these errors were encountered:
WherePri
Merge branch 'master' into fix/gogf#3330
683368a
I'll look for the answer ok
Sorry, something went wrong.
3f115fa
@oldme-git Thank you for your work. But this issue alreay have answer.
fix: WherePri function wrong in pgsql #3330 (#3339)
240dadf
Successfully merging a pull request may close this issue.
v2.6.3
There is a unique index in the table of PgSQL, WherePri identify probably an error primary key.
Please put the code in
contrib/drivers/pgsql/pgsql_z_unit_model_test.go
. In the way, you can debug it directly.Probably , it will fail.
The text was updated successfully, but these errors were encountered: