moved the database-go project to this repository

This commit is contained in:
Timmelmann
2026-08-08 14:29:33 +02:00
commit ca2740a2e7
6 changed files with 196 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
package models
import (
"github.com/stretchr/testify/assert"
)
const (
BNODE_NODE = 1
BNODE_LEAF = 2
BTREE_PAGE_SIZE = 4096
BTREE_MAX_KEY_SIZE = 1000
BTREE_MAX_VAL_SIZE = 3000
)
type Node struct {
keys [][]byte
vals [][]byte
kids []*Node
}
func init() {
node1max := HEADER + 8 + 2 + 4 + BTREE_MAX_KEY_SIZE + BTREE_MAX_VAL_SIZE
assert(node1max <= BTREE_PAGE_SIZE)
}
func Encode(node *Node) []byte {
return nil
}
func Decode(page []byte) (*Node, error) {
return nil, nil
}