Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
fbf536d
it compiles
fulldump Nov 21, 2025
aab985c
restore old collection package name
fulldump Nov 21, 2025
ab8ce11
keeps compiling
fulldump Nov 21, 2025
8315f09
Add row container + syncmap implementation
fulldump Nov 21, 2025
c76c32f
add slice container implementation (of row container interface)
fulldump Nov 21, 2025
6bae5de
optimize encoding in parallel but keeping the order
fulldump Nov 21, 2025
8b6bbde
feat: test index with Open collection throughput
fulldump Nov 21, 2025
1e6b992
Better insert performance
fulldump Nov 21, 2025
750fce5
add concurrency tests for collectionv2
fulldump Nov 21, 2025
8d75490
add abstraction Storage with several implementations
fulldump Nov 21, 2025
f8bd02e
add test remove
fulldump Nov 22, 2025
aeb68d8
add index tests
fulldump Nov 22, 2025
fb31c0a
more or less working code for full text search
fulldump Nov 25, 2025
0f68fac
add collection v3
fulldump Feb 21, 2026
c21a4ca
add collection v4
fulldump Feb 21, 2026
c1e513c
work in progress
fulldump Mar 7, 2026
ae9c250
Add RecordsTurbo (by gpt 5.3 codex)
fulldump Mar 7, 2026
81328b9
add RecordsUltra (courtesy of Gemini)
fulldump Mar 7, 2026
4b910fc
Add RecordsUltra
fulldump Mar 7, 2026
3c86519
Document Record Optimizations
fulldump Mar 8, 2026
c531942
chore: add missing suites to Correct and Fast implementations
fulldump Mar 9, 2026
c55ab30
chore: wrap up records
fulldump Mar 9, 2026
2e0635d
Integrate Records[T] in collectionv4
fulldump Mar 9, 2026
e78aed7
chore: integrate Store interface in collectionV4
fulldump Mar 9, 2026
01f36ff
tech: Add API_ANALYSIS.md
fulldump Mar 9, 2026
8a58172
refactor: extract interface storage from collectionv2
fulldump Mar 10, 2026
cf9d1b1
work in progress
fulldump Mar 13, 2026
68cbfd5
add: storage WAL
fulldump Mar 13, 2026
cedc4c6
add: collectionv4 indexes
fulldump Mar 13, 2026
44120fa
wip
fulldump Mar 13, 2026
6fe1ed7
work in progress. THIS NEEDS REVIEW V2 was replaced by V4!!!
fulldump Mar 14, 2026
90e488c
work in progress: REVIEW THIS
fulldump Mar 14, 2026
abd36e4
working shit
fulldump Mar 14, 2026
a0dd488
feat: add store json
fulldump Mar 14, 2026
a7b2826
feat: StoreCrazy + StoreFlusher + bufferPool optimization
fulldump Mar 14, 2026
d9b8971
feat: add store snappy + store async + store flusher refactorrrrrrrrrr
fulldump Mar 14, 2026
006eaa3
refactor: improve patch operation performance by 3x
fulldump Mar 14, 2026
d6d0b41
refactor: collectionv4 composable things
fulldump Mar 15, 2026
c60740d
refactor: performance: collection v4: immutable indexes
fulldump Mar 15, 2026
b2045c3
working code
fulldump Mar 17, 2026
5b2f983
working code
fulldump Mar 17, 2026
f5dd685
refactor: move stores to its own package
fulldump Mar 17, 2026
584b4ec
add 3 more tests
fulldump Mar 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ FLAGS = -ldflags "\
"

test:
go test -cover ./...
go test ./...

run:
STATICS=statics/www/ go run $(FLAGS) ./cmd/inceptiondb/...
Expand Down
41 changes: 0 additions & 41 deletions ROADMAP.md

This file was deleted.

2 changes: 0 additions & 2 deletions api/apicollectionv1/0_build.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ func BuildV1Collection(v1 *box.R, s service.Servicer) *box.R {
WithActions(
box.Get(getCollection),
box.ActionPost(insert),
box.ActionPost(insertStream), // todo: experimental!!
box.ActionPost(insertFullduplex), // todo: experimental!!
box.ActionPost(find),
box.ActionPost(remove),
box.ActionPost(patch),
Expand Down
116 changes: 97 additions & 19 deletions api/apicollectionv1/0_traverse.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@ package apicollectionv1
import (
"encoding/json"
"fmt"
"strings"

"github.com/SierraSoftworks/connor"
"github.com/buger/jsonparser"

"github.com/fulldump/inceptiondb/collection"
"github.com/fulldump/inceptiondb/collectionv4"
"github.com/fulldump/inceptiondb/utils"
)

func traverse(requestBody []byte, col *collection.Collection, f func(row *collection.Row) bool) error {
func traverse(requestBody []byte, col *collectionv4.Collection, f func(id int64, payload []byte) bool) error {

options := &struct {
Index *string
Expand All @@ -28,18 +30,97 @@ func traverse(requestBody []byte, col *collection.Collection, f func(row *collec
return err
}

hasFilter := options.Filter != nil && len(options.Filter) > 0
hasFilter := len(options.Filter) > 0

// Add simple equality filter check
isSimple := true
if hasFilter {
for k, v := range options.Filter {
if strings.HasPrefix(k, "$") || strings.Contains(k, ".") {
isSimple = false
break
}
switch v.(type) {
case string, float64, bool, nil:
// supported
default:
isSimple = false
break
}
}
}

skip := options.Skip
limit := options.Limit
iterator := func(r *collection.Row) bool {
iterator := func(id int64, payload []byte) bool {
if limit == 0 {
return false
}

if hasFilter {
// Fast path for simple equality queries
if isSimple {
match := true
for k, expected := range options.Filter {
val, dataType, _, err := jsonparser.Get(payload, k)
if err != nil {
if expected != nil {
match = false
break
}
continue
}

switch exp := expected.(type) {
case string:
if dataType != jsonparser.String {
match = false
break
}
parsedStr, err := jsonparser.ParseString(val)
if err != nil || parsedStr != exp {
match = false
}
case float64:
if dataType != jsonparser.Number {
match = false
break
}
parsedNum, err := jsonparser.ParseFloat(val)
if err != nil || parsedNum != exp {
match = false
}
case bool:
if dataType != jsonparser.Boolean {
match = false
break
}
parsedBool, err := jsonparser.ParseBoolean(val)
if err != nil || parsedBool != exp {
match = false
}
case nil:
if dataType != jsonparser.Null {
match = false
}
default:
match = false
}

if !match {
break
}
}

if !match {
return true
}
goto evaluate
}

// Slow path via json.Unmarshal and connor
rowData := map[string]interface{}{}
json.Unmarshal(r.Payload, &rowData) // todo: handle error here?
json.Unmarshal(payload, &rowData) // todo: handle error here?

match, err := connor.Match(options.Filter, rowData)
if err != nil {
Expand All @@ -52,12 +133,13 @@ func traverse(requestBody []byte, col *collection.Collection, f func(row *collec
}
}

evaluate:
if skip > 0 {
skip--
return true
}
limit--
return f(r)
return f(id, payload)
}

// Fullscan
Expand All @@ -66,24 +148,20 @@ func traverse(requestBody []byte, col *collection.Collection, f func(row *collec
return nil
}

index, exists := col.Indexes[*options.Index]
indexes := col.ListIndexes()
index, exists := indexes[*options.Index]
if !exists {
return fmt.Errorf("index '%s' not found, available indexes %v", *options.Index, utils.GetKeys(col.Indexes))
return fmt.Errorf("index '%s' not found, available indexes %v", *options.Index, utils.GetKeys(indexes))
}

index.Traverse(requestBody, iterator)

return nil
_ = index
return col.TraverseIndex(*options.Index, requestBody, iterator)
}

func traverseFullscan(col *collection.Collection, f func(row *collection.Row) bool) error {

for _, row := range col.Rows {
next := f(row)
if !next {
break
}
}
func traverseFullscan(col *collectionv4.Collection, f func(id int64, payload []byte) bool) error {
col.TraverseRecords(func(id int64, payload []byte) bool {
return f(id, payload)
})

return nil
}
4 changes: 2 additions & 2 deletions api/apicollectionv1/createCollection.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func createCollection(ctx context.Context, w http.ResponseWriter, input *createC
w.WriteHeader(http.StatusCreated)
return &CollectionResponse{
Name: input.Name,
Total: len(collection.Rows),
Defaults: collection.Defaults,
Total: int(collection.Count()),
Defaults: collection.Defaults(),
}, nil
}
12 changes: 8 additions & 4 deletions api/apicollectionv1/createIndex.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"github.com/fulldump/box"

"github.com/fulldump/inceptiondb/collection"
"github.com/fulldump/inceptiondb/collectionv4"
"github.com/fulldump/inceptiondb/service"
)

Expand Down Expand Up @@ -59,11 +59,15 @@ func createIndex(ctx context.Context, r *http.Request) (*listIndexesItem, error)

switch input.Type {
case "map":
options = &collection.IndexMapOptions{}
options = &collectionv4.IndexMapOptions{}
case "btree":
options = &collection.IndexBTreeOptions{}
options = &collectionv4.IndexBTreeOptions{}
case "fts":
options = &collectionv4.IndexFTSOptions{}
case "pk":
options = &collectionv4.IndexPKOptions{}
default:
return nil, fmt.Errorf("unexpected type '%s' instead of [map|btree]", input.Type)
return nil, fmt.Errorf("unexpected type '%s' instead of [map|btree|fts|pk]", input.Type)
}

err = json.Unmarshal(requestBody, &options)
Expand Down
9 changes: 8 additions & 1 deletion api/apicollectionv1/dropIndex.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package apicollectionv1

import (
"context"
"fmt"
"net/http"

"github.com/fulldump/box"
Expand Down Expand Up @@ -32,9 +33,15 @@ func dropIndex(ctx context.Context, w http.ResponseWriter, input *dropIndexReque
return err // todo: handle/wrap this properly
}

indexes := col.ListIndexes()
_, exists := indexes[input.Name]
if !exists {
w.WriteHeader(http.StatusBadRequest)
return fmt.Errorf("index '%s' not found", input.Name)
}

err = col.DropIndex(input.Name)
if err != nil {
w.WriteHeader(http.StatusBadRequest)
return err
}

Expand Down
7 changes: 3 additions & 4 deletions api/apicollectionv1/find.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import (
"net/http"

"github.com/fulldump/box"

"github.com/fulldump/inceptiondb/collection"
)

func find(ctx context.Context, w http.ResponseWriter, r *http.Request) error {
Expand All @@ -33,8 +31,9 @@ func find(ctx context.Context, w http.ResponseWriter, r *http.Request) error {
return err // todo: handle/wrap this properly
}

return traverse(requestBody, col, func(row *collection.Row) bool {
w.Write(row.Payload)
return traverse(requestBody, col, func(id int64, payload []byte) bool {
_ = id
w.Write(payload)
w.Write([]byte("\n"))
return true
})
Expand Down
7 changes: 4 additions & 3 deletions api/apicollectionv1/getCollection.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ func getCollection(ctx context.Context) (*CollectionResponse, error) {
return nil, err
}

indexes := collection.ListIndexes()
return &CollectionResponse{
Name: collectionName,
Total: len(collection.Rows),
Indexes: len(collection.Indexes),
Defaults: collection.Defaults,
Total: int(collection.Count()),
Indexes: len(indexes),
Defaults: collection.Defaults(),
}, nil
}
Loading
Loading