You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+54-75Lines changed: 54 additions & 75 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,26 +1,26 @@
1
-
# **OstrichDB**
1
+
# **OstrichDB CLI**
2
2
3
-
OstrichDB is a lightweight document-based NoSQL/NoJSON database management system written in Odin. It features an intuitive command structure with hierarchical data organization and built-in security, making it ideal for developers seeking a easy-to-use, flexible, high-performance database solution.
3
+
Built from scratch, the OstrichDB engine powers the OstrichDB CLI—a lightweight yet powerful database management tool for your terminal. Written in [Odin](https://odin-lang.org/), it features an intuitive query structure, hierarchical data organization, and built-in security systems, making it ideal for anyone seeking an easy-to-use, flexible, high-performance database solution.
4
4
5
5
6
6
---
7
7
8
8
## **Key Features**
9
9
10
-
- Three Modes of Operation:
11
-
-Serverless Command-line Interface
12
-
-Server Mode with HTTP API
13
-
-Server Mode with the built-in natural language processor
10
+
- Three Ways To Interact:
11
+
-Manually enter queries via the Command-line Interface
12
+
-Enable the built-in HTTP server and interact via a client in your favorite language
13
+
-(Experimental) Use natural language queries to quickly interact with your data!(Requries a bit of setup)
14
14
- User Authentication
15
15
- User Role-Based Access
16
16
- Database permissions
17
17
- Database encryption & decryption
18
-
- Custom JSON-like Hierarchical Data Structure
18
+
- Custom Hierarchical Data Structure
19
19
- .CSV & .JSON file importing
20
20
- Dot Notation Syntax when using the serverless CLI
21
-
-Command Chaining
22
-
- Built-in benchmarking, configurations, and user command history
23
-
-Exclusive macOS Support
21
+
-Query Chaining
22
+
- Built-in benchmarking, configurations, and user query history
23
+
- macOS & Linux Support
24
24
25
25
## **Installation**
26
26
@@ -30,18 +30,16 @@ OstrichDB is a lightweight document-based NoSQL/NoJSON database management syste
30
30
- The [Odin](https://odin-lang.org/) programming language installed, built, and properly set in the system's PATH. Ideal Odin Version: `dev-2024-11:764c32fd3`
31
31
*Note: You can achieve the previous step by following the [Odin Installation Guide](https://odin-lang.org/docs/install/)*
32
32
33
-
#### **Special Cases:**
34
-
- If you are an "End User" and plan install OstrichDB on your machine you will need [curl](https://curl.se/) installed
35
33
36
-
### Installation For Contributors:
34
+
### Building and Running The OstrichDB CLI Locally:
3. Open the `local_install.sh` script and follow the directions at the top of the file.
94
-
4. Run the script:
95
-
```bash
96
-
./local_install.sh
97
-
```
98
-
5. Find you installed OstirchDB executable in the `.ostrichdb` directory in the same directory you chose to install OstrichDB in via the `local_install.sh` script.
99
-
6. Run the executable by double clicking it or running it from the terminal with the following command:
75
+
4. **Run the OstrichDB CLI**
100
76
```bash
101
-
./path/to/.ostrichdb/ostrichdb
77
+
docker exec -it ostrichdb /app/main.bin
102
78
```
103
-
104
-
79
+
*Note: You can find data forOstrichDBin`.ostrichdb/data`in the project's directory, which is mapped to `/data` inside the container.
80
+
You can also change the port mapping to the host machine by updating the `docker-compose.yml` file in case port 8080 is already in use, i.e.
81
+
```
82
+
ports:
83
+
- "8089:8080"
84
+
```
105
85
106
86
---
107
87
@@ -116,38 +96,37 @@ OstrichDB organizes data into three levels:
116
96
117
97
---
118
98
119
-
## **Command Structure (CLPs)**
120
-
121
-
In OstrichDB, commands are typically broken into **three types of tokens**, called **CLPs**, to improve readability and ensure clear instructions.
99
+
## **Query Structure (CLPs)**
122
100
123
-
**Note:** Not all commands require all 3 tokens.
101
+
From the OstrichDB CLI, queries are typically broken into **three types of tokens**, called **CLPs**, to improve readability and ensure clear instructions.
124
102
103
+
**Note:** Not all queries require all 3 tokens.
125
104
126
105
1. **(C)ommand Token**: Specifies the operation to perform (e.g., `NEW`, `ERASE`, `RENAME`).
127
-
2. **(L)ocation Token**: The dot notation path that the command will be performed on (e.g., `foo.bar.baz`).
128
-
3. **(P)arameter Token(s)**: Additional parameters that change the behavior of the command (e.g., `TO`, `OF_TYPE`).
106
+
2. **(L)ocation Token**: The path using dot notation that the query will be performed on (e.g., `foo.bar.baz`).
107
+
3. **(P)arameter Token(s)**: Additional parameters that change the behavior of the query (e.g., `TO`, `OF_TYPE`).
129
108
130
109
---
131
110
132
-
### **Command Walkthrough**
111
+
### **Query Walkthrough**
133
112
134
113
```bash
135
114
NEW foo.bar.baz OF_TYPE []STRING
136
115
```
137
116
Explanation:
138
-
- **`NEW`**: Create a new object (Command token).
139
-
- **`foo`**: The fisrt object always points to a collection. (Location token). Note: If there is only 1 object given, its a collection.
140
-
- **`bar`**: The second object always to a cluster within the collection. (Location token).
141
-
- **`baz`**: The third object is always a record within the cluster. (Location token).
117
+
- **`NEW`**: Create a new data structure (Command token).
118
+
- **`foo`**: The first data structure always points to a collection. (Location token).
119
+
- **`bar`**: The second data structure always to a cluster within the collection. (Location token).
120
+
- **`baz`**: The third data structure is always a record within the cluster. (Location token).
142
121
- **`OF_TYPE`**: Specifies the data type of the record (Parameter token). Note: Only records are given data types.
143
-
- **`[]STRING`**: The record will be an array of strings (Parameter token).
122
+
- **`[]STRING`**: Token mapped to the Parameter token that precedes it. The record will be an array of strings.
144
123
145
124
---
146
125
147
-
## **Supported Commands**
126
+
## **Supported Command Tokens**
148
127
149
128
### **Single-Token Operations**
150
-
These operations perform a task without any additional arguments.
129
+
These tokens perform a task without any additional arguments.
151
130
152
131
- **`AGENT`**: Starts the OstrichDB natural language processor. Requires the server to be running in another terminal.
153
132
- **`VERSION`**: Displays the current version of OstrichDB.
@@ -160,27 +139,27 @@ These operations perform a task without any additional arguments.
160
139
- **`TREE`**: Displays the entire data structure in a tree format.
161
140
- **`CLEAR`**: Clears the console screen.
162
141
- **`HISTORY`**: Shows the current users command history.
163
-
- **`DESTROY`**: Completley destorys the entire DBMS. Including all databases, users, configs, and logs.
142
+
- **`DESTROY`**: Completeley destorys the entire DBMS. Including all databases, users, configs, and logs.
164
143
- **`BENCHMARK`**: Runs a benchmark test on the DBMS to test performance. Can be run with or without parameters.
165
144
166
145
---
167
146
168
-
### **Multi-Token Operations**
169
-
These operations allow you to perform more complex operations.
147
+
### **Multi-Token Tokens**
148
+
These tokens are used to construct queries and require one or more additional tokens.
170
149
171
150
- **`NEW`**: Create a new collection, cluster, record, or user.
172
151
- **`ERASE`**: Delete a collection, cluster, or record.
173
152
- **`RENAME`**: Rename an existing object.
174
153
- **`FETCH`**: Retrieve data from a collection, cluster, or record.
175
154
- **`SET`**: Assign a value to a record or configuration.
176
155
- **`BACKUP`**: Create a backup of a specific collection.
177
-
- **`PURGE`**: Removes all data from an object whilemaintining the object structure.
156
+
- **`PURGE`**: Removes all data from an object while maintaining the object structure.
178
157
- **`COUNT`**: Returns the number of objects within a scope. Paired with the plural form of the object type (e.g., `RECORDS`, `CLUSTERS`).
179
158
- **`SIZE_OF`**: Returns the size in bytes of an object.
180
159
- **`TYPE_OF`**: Returns the type of a record.
181
160
- **`CHANGE_TYPE`**: Allows you to change the type of a record.
182
161
- **`HELP`**: Displays help information for a specific token.
183
-
- **`ISOLATE`**: Quarentines a collection file. Preventing any further changes to the file
162
+
- **`ISOLATE`**: Quarantines a collection file. Preventing any further changes to the file
184
163
- **`WHERE`**: Searches for the location of a single or several record(s) or cluster(s). DOES NOT WORK WITH COLLECTIONS.
185
164
- **`VALIDATE`**: Validates a collection file for any errors or corruption.
186
165
- **`BENCHMARK`**: Runs a benchmark test on the DBMS to test performance. Can be run with or without parameters.
@@ -192,14 +171,14 @@ These operations allow you to perform more complex operations.
192
171
---
193
172
194
173
### **Parameters**
195
-
Modifiers adjust the behavior of commands. The current supported modifiers are:
174
+
Modifiers adjust the behavior of queries. The current supported modifiers are:
196
175
197
176
- **`OF_TYPE`**: Specifies the type of a new record (e.g., INT, STR, []BOOL)
198
177
- **`WITH`**: Used to assign a value to a record in the same command you are creating it(e.g `NEW {collection_name}.{cluster_name}.{record_name} OF_TYPE {record_type} WITH {record_value}`)
199
178
- **`TO`**: Used to assign a new value or name to a data structure or config(e.g `RENAME {old_collection_name} to {new_collection_name}`)
200
179
201
-
### **Command Chaining**
202
-
OstrichDB supports command chaining, allowing you to execute multiple commandsin sequence with a single input. Commands are separated by the `&&` operator, and they will be executed in the order they appear.
180
+
### **Query Chaining**
181
+
OstrichDB supports query chaining, allowing you to execute multiple queries in sequence with a single input. To chain queries together add the `&&` operator at the end of each valid query, and they will be executed in the order they appear.
203
182
204
183
Example:
205
184
```bash
@@ -272,11 +251,11 @@ OstrichDB has a configuration file that allows the user to customize certain asp
272
251
273
252
- **`HELP_IS_VERBOSE`**: Decide whether help information is simple or verbose. Default is `false`
274
253
- **`SUPPRESS_ERRORS`**: Show or hide error messages. Default is `false`
275
-
- **`LIMIT_HISTORY`**: Ensure whether a users commandhistory does or does not exceed the built in limit(100) Default is `true`
254
+
- **`LIMIT_HISTORY`**: Ensure whether a users queryhistory does or does not exceed the built in limit(100) Default is `true`
276
255
- **`AUTO_SERVE`**: Determines if the built-in OstrichDB server automatically starts the moment the user logs in. Default is `true`
277
256
- **`LIMIT_SESSION_TIME`**: Determines if the CLI session timer is enabled or disabled. If enabled a user can only be logged infor 24hrs. Default is `true`
278
257
279
-
**Note: ALL configs must be set using the following command:**
258
+
**Note: ALL configs must be set using the following query:**
280
259
Config values can only be `true` or `false`
281
260
282
261
```
@@ -286,13 +265,13 @@ SET CONFIG {CONFIG_NAME} TO {VALUE}
286
265
---
287
266
## **Future Plans**
288
267
268
+
- A new and improved engine!
289
269
- More configuration options
290
-
- Several new command tokens:
270
+
- Several new Command tokens:
291
271
- `EXPORT`: Export data to various formats
292
272
- `RESTORE`: Restores a collection backup in the place of the original collection
293
273
- `MERGE`: Combine multiple collections or clusters into one
294
274
- OstrichDB web application
295
-
- Linux support
296
275
- Windows support
297
276
- External API support for even more programming languages!
298
277
- Integration with the planned Feather query language!
0 commit comments