Added start of db rework, also added Qol changes
This commit is contained in:
20
internal/database/table.go
Normal file
20
internal/database/table.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package database
|
||||
|
||||
import "database/sql"
|
||||
|
||||
type DbStatus int
|
||||
|
||||
const (
|
||||
New DbStatus = iota
|
||||
Loaded
|
||||
Updated
|
||||
)
|
||||
|
||||
// Table TODO: This Could probably be a generic instead of interface / both
|
||||
type Table[K comparable, T any] interface {
|
||||
Get(key K) (T, bool)
|
||||
Set(key K, new T)
|
||||
All() []T
|
||||
Save(db *sql.DB) error
|
||||
Load(db *sql.DB) error
|
||||
}
|
||||
Reference in New Issue
Block a user