SNL Spec
Structured Native Language (SNL 1.0): A lightweight, semicolon-segmented instruction format optimized for shadeDB low-latency engine paths. Rebuilt based on early tester feedback for clean scanning and zero-AST parsing execution.
Fetch
Direct point retrieval via key-value lookups. Optimized for ultra-low latency $O(1)$ read-paths.
fetch;username::shade; get(username,id,bio)
fetch;username::shade; verify(password='entered_password')
fetch;username::shade; update(username='ola')
Where / Compound Filtering
Sequential evaluation of un-indexed fields using compound criteria. Conditional logic is segmented by strict boundary parsing operators:
• Use || to define an explicit OR boundary.
• Use && to enforce a conditional AND parameter requiring all evaluated expressions to be truthy.
where;age::18||gender::male;get(username,bio,id);order(descend);start 0, limit 500
where;age::18||gender::male;order(random);limit 500
where;age::47&&gender::male;get(username,bio,profile_pic);order(random);start 0, limit 50
Insert
Atomic JSON ingestion into the storage layer. Fails natively if primary keys or explicitly configured unique criteria collide.
insert; JsonString
Update
Primary target state mutations. Mutates selective document payload mappings securely without heavy payload rewriting overhead.
update;username::shade; JsonString
Delete
Immediate single or structural deletion of matching items from memory/disk vectors.
delete;username::shade
Type Declarations
Define rigid data validation wrappers directly inside the input vector to preserve microsecond engine integrity benchmarks:
str(data) -> Enforces standard string constraints. Enclose contents cleanly inside quotes.
int(101) -> Signed and unsigned whole integer evaluations.
float(0.75) -> Explicit point evaluations for fractional data lookups.
bool(True) -> Resolves strictly into truthy/falsy engine binary bits.
Type Casting Reference
A quick summary look at target wrapper declarations during evaluation processing.
| Target Type | Valid SNL Input Syntax |
|---|---|
| String Evaluation | str(shade) |
| Integer Evaluation | int(91555) |
| Float Evaluation | float(0.9) |
| Boolean Evaluation | bool(True) |
Execution Modifiers
Functional parameters appended via semicolon markers to manipulate indexing slices and ordering priorities.
| Modifier API | Engine Execution Mapping |
|---|---|
start X, limit Y | Slices dataset cleanly starting at index window position X, bounding to size Y. |
limit Y | Caps execution scan immediately upon gathering Y matching elements. |
order(ascend) | Sorts matching output values sequentially using chronological tracking. |
order(descend) | Sorts matching output values sequentially using reverse chronological tracking. |
order(random) | Instructs index vectors to randomize matching returns instantly inside memory maps. |
Constraints
Engine-level enforcement of identity vectors. The designated index marker field acts as the fundamental tracking root.
PRIMARY_UNIQUE_KEY_ENFORCEMENT : [ ID ]
Integration
Incorporate the official driver wrapper to bind shadeDB instances into Python runtime scopes instantly:
pip install shadedb-api
Registry Index: pypi.org/project/shadedb-api