diff --git a/collection.go b/collection.go index 4625adc..b8355d2 100644 --- a/collection.go +++ b/collection.go @@ -180,7 +180,7 @@ func (c *Collection[T]) loadData() { } } -func (c *Collection[T]) onStore(collection string, id uint64, data []byte) { +func (c *Collection[T]) onStore(id uint64, data []byte) { item := decode[T](data) old, ok := c.items.Get(id) if !ok { @@ -196,7 +196,7 @@ func (c *Collection[T]) onStore(collection string, id uint64, data []byte) { } } -func (c *Collection[T]) onDelete(collection string, id uint64) { +func (c *Collection[T]) onDelete(id uint64) { if item, ok := c.items.Get(id); ok { for _, idx := range c.indices { idx.delete(item) diff --git a/database.go b/database.go index c74addf..fbd9801 100644 --- a/database.go +++ b/database.go @@ -81,14 +81,14 @@ func (db *Database) Close() { func (db *Database) onStore(collection string, id uint64, data []byte) { c, ok := db.collections[collection] if ok { - c.onStore(collection, id, data) + c.onStore(id, data) } } func (db *Database) onDelete(collection string, id uint64) { c, ok := db.collections[collection] if ok { - c.onDelete(collection, id) + c.onDelete(id) } } diff --git a/types.go b/types.go index 9baa3eb..8d80416 100644 --- a/types.go +++ b/types.go @@ -23,6 +23,6 @@ type itemUniqueIndex[T any] interface { type dbCollection interface { loadData() - onStore(string, uint64, []byte) // For WAL following. - onDelete(string, uint64) // For WAL following. + onStore(uint64, []byte) // For WAL following. + onDelete(uint64) // For WAL following. }