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
my code works well befor using sharding middleware:
func (r *MySQLRepo) PlanExists(id uint) (bool, error) { var exists bool err := r.db.Model(&entity.StockPlan{}). Select("count(*) > 0"). Where("id = ?", id). Find(&exists). Error return exists, err }
but the error occurs after registering sharding like this:
db.Use(sharding.Register(sharding.Config{ ShardingKey: "title", NumberOfShards: 4, PrimaryKeyGenerator: sharding.PKSnowflake, }, "stock_plans"))
and the error is:
Error 1054: Unknown column 'stock_plans.deleted_at' in 'where clause'
The text was updated successfully, but these errors were encountered:
var exists bool err := db.Model(&Order{}). Select("count(*) > 0"). Where("id = ?", int64(10)). Find(&exists). Error assert.Equal(t, nil, err)
Above code can not get the error, can you provide more information?
Sorry, something went wrong.
jinzhu
No branches or pull requests
my code works well befor using sharding middleware:
but the error occurs after registering sharding like this:
and the error is:
The text was updated successfully, but these errors were encountered: