asdine / storm

Simple and powerful toolkit for BoltDB
MIT License
2.06k stars 139 forks source link

Save a struct with ID #259

Open skynet0590 opened 5 years ago

skynet0590 commented 5 years ago

For example. I have a struct

User struct {
 ID int
 Name string
}

When I insert a new User with no zero ID and higher with the last ID of User. The bucket still be no update the last ID. This make error when I create more User with zero ID. The user will fill up and when it reach the User was created by no zero ID. A new User will replace the old.