KV存储增加panic处理

This commit is contained in:
GoEdgeLab
2024-03-24 17:13:12 +08:00
parent 83a086f67f
commit 3a449c42fa
5 changed files with 82 additions and 26 deletions

View File

@@ -60,6 +60,10 @@ func (this *Table[T]) SetDB(db *DB) {
this.db = db
}
func (this *Table[T]) DB() *DB {
return this.db
}
func (this *Table[T]) Set(key string, value T) error {
if len(key) > KeyMaxLength {
return ErrKeyTooLong