KV存储增加panic处理

This commit is contained in:
刘祥超
2024-03-24 17:13:12 +08:00
parent 03e8394bff
commit d9cf043cfe
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