Add mechanism for initializing database with produce

This commit is contained in:
2021-06-21 11:47:51 -04:00
parent caa9db586c
commit 6e99e495b3
6 changed files with 47 additions and 4 deletions
+5 -1
View File
@@ -1,5 +1,7 @@
package ramdb
import "sync"
type database struct {
tables map[string]*table
}
@@ -28,7 +30,9 @@ func (db *database) CreateTable(tablename string, indexOnColumns ...string) erro
}
tbl := &table{
exists: true,
exists: true,
mutex: &sync.Mutex{},
indexes: make(map[string]*index),
}
for _, onColumn := range indexOnColumns {