Files
zeekay a3b53a21b5 feat: make leveldb and pebbledb optional via build tags
- Add //go:build leveldb to all leveldb package files
- Add //go:build pebbledb to all pebbledb package files
- Refactor factory to use registration pattern
- Refactor manager to use registration pattern
- badgerdb is now the only default database
- Build with -tags=leveldb or -tags=pebbledb to enable them
2025-12-21 12:02:37 -08:00

26 lines
531 B
Go

// Copyright (C) 2020-2025, Lux Industries Inc. All rights reserved.
// See the file LICENSE for licensing terms.
//go:build leveldb
package leveldb
import (
"github.com/luxfi/database"
"github.com/syndtr/goleveldb/leveldb"
)
// updateError converts a leveldb-specific error to its Lux equivalent, if applicable.
func updateError(err error) error {
switch err {
case nil:
return nil
case leveldb.ErrClosed:
return database.ErrClosed
case leveldb.ErrNotFound:
return database.ErrNotFound
default:
return err
}
}