Added start of db rework, also added Qol changes

This commit is contained in:
Pablu23
2024-04-02 16:35:50 +02:00
parent 1377fd420e
commit ce878efce3
7 changed files with 211 additions and 22 deletions

View 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
}