Skip to content

Commit

Permalink
Merge pull request #202 from Solitude-Software-Solutions/Pre_Rel_v0.6…
Browse files Browse the repository at this point in the history
….0_dev

Pre Rel v0.6.0
  • Loading branch information
SchoolyB authored Feb 5, 2025
2 parents 06f43c1 + 2ae4ff6 commit 2560995
Show file tree
Hide file tree
Showing 41 changed files with 4,022 additions and 2,724 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: OstrichDB CI

on:
push:
branches: [ "main", "development" ]
pull_request:
branches: [ "main", "development" ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Install Odin
run: |
git clone https://github.com/odin-lang/Odin
cd Odin
make
- name: Add Odin to PATH
run: echo "${GITHUB_WORKSPACE}/Odin" >> $GITHUB_PATH

- name: Make CI build script executable
run: chmod +x scripts/ci-build.sh

- name: Run CI build script
run: |
cd scripts
./ci-build.sh
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ ols.json
.exe
.out
.vscode
.vs
.DS_Store

# Uncomment these two when actually implementing zig
Expand Down
2 changes: 1 addition & 1 deletion LICENCE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2024 Marshall A Burns and Solitude Software Solutions LLC
Copyright 2024 - 2025 Marshall A Burns and Solitude Software Solutions LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
70 changes: 34 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,37 +29,38 @@ OstrichDB organizes data into three levels:

---

## **Command Structure (ATOMs)**
## **Command Structure (CLPs)**

In ObstrichDB, commands are typically broken into **four types of tokens**, called **ATOMs**, to improve readability and ensure clear instructions.
In OstrichDB, commands are typically broken into **three types of tokens**, called **CLPs**, to improve readability and ensure clear instructions.

**Note:** Not all commands require all four tokens.
**Note:** Not all commands require all 3 tokens.

1. **(A)ction Token**: Specifies the operation to perform (e.g., `NEW`, `ERASE`, `RENAME`).
2. **(T)arget Token**: The type of object that the action is being performed on (e.g., `CLUSTER`, `RECORD`).
3. **(O)bject Token**: The name of the target object (e.g., `foo`, `bar`).
4. **(M)odifier Token**: Additional parameters that change the behavior of the command (e.g.,`TO`, `OF_TYPE`).

1. **(C)ommand Token**: Specifies the operation to perform (e.g., `NEW`, `ERASE`, `RENAME`).
2. **(L)ocation Token**: The dot notation path that the command will be performed on (e.g., `foo.bar.baz`).
3. **(P)arameter Token(s)**: Additional parameters that change the behavior of the command (e.g., `TO`, `OF_TYPE`).

---

### **Command Example**
### **Command Walkthrough**

```bash
NEW CLUSTER foo.bar
NEW foo.bar.baz OF_TYPE []STRING
```

Explanation:
- **`NEW`**: Create a new object (Action token).
- **`CLUSTER`**: The type of object to be created (Target token).
- **`foo`**: The parent object that the new cluster will be created in (Object token).
- **`bar`**: The name of the new cluster (Object token).
- **`NEW`**: Create a new object (Command token).
- **`foo`**: The fisrt object always points to a collection. (Location token). Note: If there is only 1 object given, its a collection.
- **`bar`**: The second object always to a cluster within the collection. (Location token).
- **`baz`**: The third object is always a record within the cluster. (Location token).
- **`OF_TYPE`**: Specifies the data type of the record (Parameter token). Note: Only records are given data types.
- **`[]STRING`**: The record will be an array of strings (Parameter token).

---

## **Supported Commands**

### **Single-Token Actions**
These actions perform simple tasks without needing additional arguments.
### **Single-Token Operations**
These operations perform simple tasks without needing additional arguments.

- **`VERSION`**: Displays the current version of OstrichDB.
- **`LOGOUT`**: Logs out the current user.
Expand All @@ -75,8 +76,8 @@ These actions perform simple tasks without needing additional arguments.

---

### **Multi-Token Actions**
These actions allow you to perform more complex operations.
### **Multi-Token Operations**
These operations allow you to perform more complex operations.

- **`NEW`**: Create a new collection, cluster, record, or user.
- **`ERASE`**: Delete a collection, cluster, or record.
Expand All @@ -88,16 +89,17 @@ These actions allow you to perform more complex operations.
- **`COUNT`**: Returns the number of objects within a scope. Paired with the plural form of the object type (e.g., `RECORDS`, `CLUSTERS`).
- **`SIZE_OF`**: Returns the size in bytes of an object.
- **`TYPE_OF`**: Returns the type of a record.
- **`HELP`**: Displays help information for a specific ATOM.
- **`CHANGE_TYPE`**: Allows you to change the type of a record.
- **`HELP`**: Displays help information for a specific token.
- **`ISOLATE`**: Quarentines a collection file. Preventing any further changes to the file
- **`WHERE`**: Searches for a record or cluster by name. DOES NOT WORK WITH COLLECTIONS.
---

### **Modifiers in Commands**
### **Parameters**

Modifiers adjust the behavior of commands. The current supported modifiers are:
- **`TO`**: Used to assign a new value or name (e.g., renaming an object or setting a record's value).
- **`OF_TYPE`**: Specifies the type of a new record (e.g., INT, STR).
- **`OF_TYPE`**: Specifies the type of a new record (e.g., INT, STR, []BOOL).


## **Supported Record Data Type Tokens**
Expand Down Expand Up @@ -158,25 +160,25 @@ Other supported data types include:
## **Usage Examples**
```bash
# Create a new collection:
NEW COLLECTION staff
NEW staff
# Create a new cluster:
NEW CLUSTER staff.engineering
NEW staff.engineering
# Create a new record:
NEW RECORD staff.engineering.team_one OF_TYPE []STRING
NEW staff.engineering.team_one OF_TYPE []STRING
# Set a record value:
SET RECORD staff.engineers.team_one TO Alice,Bob,Charlie
SET staff.engineers.team_one TO Alice,Bob,Charlie
# Fetch the record value:
FETCH RECORD staff.engineers.team_one
FETCH staff.engineers.team_one
# Rename a cluster:
RENAME CLUSTER staff.engineering TO HR
RENAME staff.engineering TO HR
# Get the size of a cluster:
SIZE_OF CLUSTER staff.HR
SIZE_OF staff.HR
# Erase a record:
ERASE RECORD staff.HR.team_one
ERASE staff.HR.team_one
# Get a count of all collections in the database:
COUNT COLLECTIONS
# Get help on a specific ATOM
HELP RECORD
#Get help information for a specific token:
HELP {TOKEN_NAME}
# Get general help information
HELP
# Create a new user
Expand All @@ -189,18 +191,14 @@ Other supported data types include:
- More configuration options
- Database file compression and zipping
- Several new command tokens:
- `SORT`: Sort records or clusters by field
- `IMPORT`: Load data from external sources(JSON, CSV, etc.)
- `EXPORT`: Export data to various formats
- `VALIDATE`: Check data integrity
- `LOCK`: Prevent data modification
- `UNLOCK`: Allow data modification
- `RESTORE`: Restores a collection backup in the place of the original collection
- `MERGE`: Combine multiple collections or clusters into one
- `ALL`: Perform operations on all objects within a scope
- Support for additional data types
- Enhanced security (database encryption/decryption, secure deletion)
- Commnad chaining for complex operations
- Command chaining for complex operations
- Server-based architecture improvements
- External API support for popular programming languages
- Windows support
Expand Down
29 changes: 29 additions & 0 deletions scripts/ci-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash

# Get the directory of this script
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

# Change to the project root directory
cd "$DIR/.."

# Change to the src directory
cd src

# Build the project in the src directory
odin build main

# Check if build was successful
if [ $? -eq 0 ]; then
echo "$(tput setaf 2)Build successful$(tput sgr0)"

# Try to create bin directory and move the executable
if mkdir -p ../bin 2>/dev/null && mv main.bin ../bin/ 2>/dev/null; then
echo "$(tput setaf 2)Successfully moved executable to bin directory$(tput sgr0)"
else
echo "$(tput setaf 1)Could not move executable to bin directory$(tput sgr0)"
exit 1
fi
else
echo "$(tput setaf 1)Build failed$(tput sgr0)"
exit 1
fi
Loading

0 comments on commit 2560995

Please sign in to comment.