axiodb 15.0.1 → 16.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/cli/VERSION +1 -0
- package/cli/cmd/collection.go +169 -0
- package/cli/cmd/connect.go +597 -0
- package/cli/cmd/db.go +171 -0
- package/cli/cmd/document.go +376 -0
- package/cli/cmd/index.go +101 -0
- package/cli/cmd/ping.go +36 -0
- package/cli/cmd/root.go +36 -0
- package/cli/cmd/version.go +41 -0
- package/cli/go.mod +15 -0
- package/cli/go.sum +20 -0
- package/cli/internal/config/config.go +111 -0
- package/cli/main.go +7 -0
- package/cli/pkg/commands/collection.go +68 -0
- package/cli/pkg/commands/db.go +62 -0
- package/cli/pkg/commands/document.go +184 -0
- package/cli/pkg/commands/index.go +51 -0
- package/cli/pkg/protocol/auth.go +46 -0
- package/cli/pkg/protocol/client.go +174 -0
- package/cli/pkg/protocol/message.go +75 -0
- package/lib/Services/Aggregation/Aggregation.Operation.d.ts +5 -44
- package/lib/Services/Aggregation/Aggregation.Operation.js +54 -214
- package/lib/Services/Aggregation/Aggregation.Operation.js.map +1 -1
- package/lib/Services/Aggregation/OperatorRegistry.d.ts +11 -0
- package/lib/Services/Aggregation/OperatorRegistry.js +35 -0
- package/lib/Services/Aggregation/OperatorRegistry.js.map +1 -0
- package/lib/Services/Aggregation/operators/accumulatorOperators.d.ts +12 -0
- package/lib/Services/Aggregation/operators/accumulatorOperators.js +138 -0
- package/lib/Services/Aggregation/operators/accumulatorOperators.js.map +1 -0
- package/lib/Services/Aggregation/operators/expressionOperators.d.ts +3 -0
- package/lib/Services/Aggregation/operators/expressionOperators.js +587 -0
- package/lib/Services/Aggregation/operators/expressionOperators.js.map +1 -0
- package/lib/Services/Aggregation/operators/stageOperators.d.ts +38 -0
- package/lib/Services/Aggregation/operators/stageOperators.js +564 -0
- package/lib/Services/Aggregation/operators/stageOperators.js.map +1 -0
- package/lib/Services/Collection/collection.operation.d.ts +3 -1
- package/lib/Services/Collection/collection.operation.js +3 -2
- package/lib/Services/Collection/collection.operation.js.map +1 -1
- package/lib/Services/Database/database.operation.d.ts +8 -0
- package/lib/Services/Database/database.operation.js +72 -1
- package/lib/Services/Database/database.operation.js.map +1 -1
- package/lib/config/DB.d.ts +5 -1
- package/lib/config/DB.js +5 -1
- package/lib/config/DB.js.map +1 -1
- package/lib/config/Interfaces/Operation/aggregation.interface.d.ts +9 -0
- package/lib/config/Interfaces/Operation/aggregation.interface.js +4 -0
- package/lib/config/Interfaces/Operation/aggregation.interface.js.map +1 -0
- package/lib/server/public/AxioControl/.vite/manifest.json +1 -1
- package/lib/server/public/AxioControl/assets/{index-DkwtNvzk.js → index-BRccHygR.js} +31 -31
- package/lib/server/public/AxioControl/index.html +1 -1
- package/lib/server/public/AxioControl/sw.js +1 -1
- package/opencode.json +9 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -155,7 +155,7 @@ const db = new AxioDB({
|
|
|
155
155
|
### Querying
|
|
156
156
|
- **Chainable Query API:** `.query()`, `.Sort()`, `.Limit()`, `.Skip()`, `.setCount()`, `.setProject()`, `.exec()` / `.findOne()`
|
|
157
157
|
- **MongoDB-style Query Operators:** `$gt`, `$gte`, `$lt`, `$lte`, `$ne`, `$in`, `$nin`, `$exists`, `$regex`, `$or`, `$and`
|
|
158
|
-
- **Aggregation Pipelines:** MongoDB-compatible (`$match`, `$group`, `$sort`, `$project`, `$limit`, `$skip`, `$unwind`, `$addFields`, ...)
|
|
158
|
+
- **Aggregation Pipelines:** 60+ MongoDB-compatible stages (`$match`, `$group`, `$sort`, `$project`, `$limit`, `$skip`, `$unwind`, `$addFields`, `$lookup`, `$facet`, `$bucket`, `$count`, `$sample`, ...) with full expression evaluator, cross-collection `$lookup` joins, and custom operator registration via `OperatorRegistry`
|
|
159
159
|
- **Bulk Operations:** high-performance `insertMany`, `UpdateMany`, `deleteMany`
|
|
160
160
|
|
|
161
161
|
### Indexing
|
|
@@ -882,7 +882,7 @@ For vulnerability reporting, see [SECURITY.md](SECURITY.md).
|
|
|
882
882
|
| **Built-in caching** | ❌ | ❌ | ❌ | ✅ InMemoryCache |
|
|
883
883
|
| **Worker Threads** | ❌ | ❌ | ❌ | ✅ |
|
|
884
884
|
| **ACID Transactions** | ❌ | ❌ | ✅ | ✅ |
|
|
885
|
-
| **Aggregation Pipelines** | ❌ | Partial | ❌ | ✅
|
|
885
|
+
| **Aggregation Pipelines** | ❌ | Partial | ❌ | ✅ 60+ stages, $lookup, custom operators |
|
|
886
886
|
| **TypeScript support** | ✅ | Partial | ✅ | ✅ Full |
|
|
887
887
|
| **Electron compatible** | ✅ | ✅ | ❌ (requires rebuild) | ✅ |
|
|
888
888
|
| **Sweet spot** | <5K docs | <100K docs | 10M+ (relational) | 10K–500K docs |
|
package/cli/VERSION
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
16.2.0
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
package cmd
|
|
2
|
+
|
|
3
|
+
import (
|
|
4
|
+
"fmt"
|
|
5
|
+
|
|
6
|
+
"github.com/nexoral/axiodb-cli/internal/config"
|
|
7
|
+
"github.com/nexoral/axiodb-cli/pkg/commands"
|
|
8
|
+
"github.com/nexoral/axiodb-cli/pkg/protocol"
|
|
9
|
+
"github.com/spf13/cobra"
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
var collectionCmd = &cobra.Command{
|
|
13
|
+
Use: "collection",
|
|
14
|
+
Short: "Collection operations",
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
var collectionCreateCmd = &cobra.Command{
|
|
18
|
+
Use: "create <name>",
|
|
19
|
+
Short: "Create a collection",
|
|
20
|
+
Args: cobra.ExactArgs(1),
|
|
21
|
+
RunE: func(cmd *cobra.Command, args []string) error {
|
|
22
|
+
cfg, err := config.FromFlags(cmd)
|
|
23
|
+
if err != nil {
|
|
24
|
+
return err
|
|
25
|
+
}
|
|
26
|
+
if cfg.DB == "" {
|
|
27
|
+
return fmt.Errorf("--db flag is required")
|
|
28
|
+
}
|
|
29
|
+
client, err := cfg.ConnectAndAuth()
|
|
30
|
+
if err != nil {
|
|
31
|
+
return err
|
|
32
|
+
}
|
|
33
|
+
defer client.Disconnect()
|
|
34
|
+
|
|
35
|
+
resp, err := commands.CreateCollection(client, cfg.DB, args[0])
|
|
36
|
+
if err != nil {
|
|
37
|
+
return err
|
|
38
|
+
}
|
|
39
|
+
return printOutput(cfg.Output, resp)
|
|
40
|
+
},
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
var collectionDeleteCmd = &cobra.Command{
|
|
44
|
+
Use: "delete <name>",
|
|
45
|
+
Short: "Delete a collection",
|
|
46
|
+
Args: cobra.ExactArgs(1),
|
|
47
|
+
RunE: func(cmd *cobra.Command, args []string) error {
|
|
48
|
+
cfg, err := config.FromFlags(cmd)
|
|
49
|
+
if err != nil {
|
|
50
|
+
return err
|
|
51
|
+
}
|
|
52
|
+
if cfg.DB == "" {
|
|
53
|
+
return fmt.Errorf("--db flag is required")
|
|
54
|
+
}
|
|
55
|
+
client, err := cfg.ConnectAndAuth()
|
|
56
|
+
if err != nil {
|
|
57
|
+
return err
|
|
58
|
+
}
|
|
59
|
+
defer client.Disconnect()
|
|
60
|
+
|
|
61
|
+
resp, err := commands.DeleteCollection(client, cfg.DB, args[0])
|
|
62
|
+
if err != nil {
|
|
63
|
+
return err
|
|
64
|
+
}
|
|
65
|
+
return printOutput(cfg.Output, resp)
|
|
66
|
+
},
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
var collectionExistsCmd = &cobra.Command{
|
|
70
|
+
Use: "exists <name>",
|
|
71
|
+
Short: "Check if a collection exists",
|
|
72
|
+
Args: cobra.ExactArgs(1),
|
|
73
|
+
RunE: func(cmd *cobra.Command, args []string) error {
|
|
74
|
+
cfg, err := config.FromFlags(cmd)
|
|
75
|
+
if err != nil {
|
|
76
|
+
return err
|
|
77
|
+
}
|
|
78
|
+
if cfg.DB == "" {
|
|
79
|
+
return fmt.Errorf("--db flag is required")
|
|
80
|
+
}
|
|
81
|
+
client, err := cfg.ConnectAndAuth()
|
|
82
|
+
if err != nil {
|
|
83
|
+
return err
|
|
84
|
+
}
|
|
85
|
+
defer client.Disconnect()
|
|
86
|
+
|
|
87
|
+
exists, err := commands.CollectionExists(client, cfg.DB, args[0])
|
|
88
|
+
if err != nil {
|
|
89
|
+
return err
|
|
90
|
+
}
|
|
91
|
+
fmt.Printf("Collection '%s' exists: %v\n", args[0], exists)
|
|
92
|
+
return nil
|
|
93
|
+
},
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
var collectionInfoCmd = &cobra.Command{
|
|
97
|
+
Use: "info",
|
|
98
|
+
Short: "Get collection information",
|
|
99
|
+
RunE: func(cmd *cobra.Command, args []string) error {
|
|
100
|
+
cfg, err := config.FromFlags(cmd)
|
|
101
|
+
if err != nil {
|
|
102
|
+
return err
|
|
103
|
+
}
|
|
104
|
+
if cfg.DB == "" {
|
|
105
|
+
return fmt.Errorf("--db flag is required")
|
|
106
|
+
}
|
|
107
|
+
client, err := cfg.ConnectAndAuth()
|
|
108
|
+
if err != nil {
|
|
109
|
+
return err
|
|
110
|
+
}
|
|
111
|
+
defer client.Disconnect()
|
|
112
|
+
|
|
113
|
+
resp, err := commands.GetCollectionInfo(client, cfg.DB)
|
|
114
|
+
if err != nil {
|
|
115
|
+
return err
|
|
116
|
+
}
|
|
117
|
+
return printOutput(cfg.Output, resp)
|
|
118
|
+
},
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
var collectionListCmd = &cobra.Command{
|
|
122
|
+
Use: "list",
|
|
123
|
+
Short: "List all collections in a database",
|
|
124
|
+
RunE: func(cmd *cobra.Command, args []string) error {
|
|
125
|
+
cfg, err := config.FromFlags(cmd)
|
|
126
|
+
if err != nil {
|
|
127
|
+
return err
|
|
128
|
+
}
|
|
129
|
+
if cfg.DB == "" {
|
|
130
|
+
return fmt.Errorf("--db flag is required")
|
|
131
|
+
}
|
|
132
|
+
client, err := cfg.ConnectAndAuth()
|
|
133
|
+
if err != nil {
|
|
134
|
+
return err
|
|
135
|
+
}
|
|
136
|
+
defer client.Disconnect()
|
|
137
|
+
|
|
138
|
+
resp, err := commands.GetCollectionInfo(client, cfg.DB)
|
|
139
|
+
if err != nil {
|
|
140
|
+
return err
|
|
141
|
+
}
|
|
142
|
+
return printOutput(cfg.Output, resp)
|
|
143
|
+
},
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
func init() {
|
|
147
|
+
collectionCmd.AddCommand(collectionCreateCmd)
|
|
148
|
+
collectionCmd.AddCommand(collectionDeleteCmd)
|
|
149
|
+
collectionCmd.AddCommand(collectionExistsCmd)
|
|
150
|
+
collectionCmd.AddCommand(collectionInfoCmd)
|
|
151
|
+
collectionCmd.AddCommand(collectionListCmd)
|
|
152
|
+
rootCmd.AddCommand(collectionCmd)
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
func createCollection(client *protocol.Client, dbName, collName string) (*protocol.Response, error) {
|
|
156
|
+
return commands.CreateCollection(client, dbName, collName)
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
func deleteCollection(client *protocol.Client, dbName, collName string) (*protocol.Response, error) {
|
|
160
|
+
return commands.DeleteCollection(client, dbName, collName)
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
func collectionExists(client *protocol.Client, dbName, collName string) (bool, error) {
|
|
164
|
+
return commands.CollectionExists(client, dbName, collName)
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
func getCollectionInfo(client *protocol.Client, dbName string) (*protocol.Response, error) {
|
|
168
|
+
return commands.GetCollectionInfo(client, dbName)
|
|
169
|
+
}
|