Role: Lead Technical Writer & Systems Analyst.
Core Engine The heart of Latha DB is a custom Java-based immutable ledger system. It prioritizes data integrity and auditability.
- .latha (JSON): The primary storage format, human-readable and easy to debug.
- .latha-bin (Compressed): A compact, binary storage format for efficiency in production environments.
Polyglot Interface Latha DB supports multiple ways to interact with your data:
- Lisp Mode: The native, powerful S-Expression based query language (e.g.,
(select :all :from "Table")). - SQL Mode: A built-in transpiler that converts standard SQL queries into Lisp commands on the fly, easing adoption.
- Visual Mode: The "Blueprint" node editor and Graph Visualizer for a no-code/low-code experience.
Deployment
- Native Image: Compiled via GraalVM for instant startup times, removing the need for a pre-installed JVM on the target machine.
- Network: Built with a Master-Slave Replication model and a robust Client-Server architecture for scalability.
This section lists every valid command in Latha DB.
Create Table Define a new table schema.
- Lisp:
(create-table "Name" :columns {"Col" "Type"}) - SQL:
CREATE TABLE Name (Col Type)
Drop Table Remove an existing table and its data.
- Lisp:
(drop-table "Name") - SQL: N/A (Use Lisp command)
Insert Add new records to a table.
- Lisp:
(insert :into "Users" {"name" "Kisu" "age" 24}) - SQL:
INSERT INTO Users (name, age) VALUES ('Kisu', 24)
Select Retrieve all records from a table.
- Lisp:
(select :all :from "Users") - SQL:
SELECT * FROM Users
Filter (Where) Retrieve records matching specific criteria.
- Lisp:
(select :all :from "Users" (where (> :age 18))) - SQL:
SELECT * FROM Users WHERE age > 18
Update Modify existing records.
- Lisp:
(update "Users" (set :age 25) (where (eq :name "Kisu"))) - SQL:
UPDATE Users SET age = 25 WHERE name = 'Kisu'
Delete Remove records from a table.
- Lisp:
(delete :from "Users" (where (< :score 0))) - SQL:
DELETE FROM Users WHERE score < 0
Vector Search (AI) Perform similarity searches on vector embeddings.
- Lisp:
(find-similar :column :vec_data :limit 5)
Graph Path Find connections between nodes in a graph structure.
- Lisp:
(find-path :from "NodeA" :to "NodeB")
Charting Generate visual plots from query results.
- Lisp:
(plot :type :bar :x "Date" :y "Sales" :from "Orders")
Query Explorer The main REPL (Read-Eval-Print Loop) interface. It features:
- Syntax Highlighting: Color-coded text for better readability.
- Auto-Translate: Type in SQL and see the Lisp equivalent instantly.
Data Visualizer Explore your data relationships visually.
- Force-Directed Graph: Load a file to see nodes and edges. Interact with the physics engine by dragging nodes or pausing the simulation.
- Color Coding: Nodes are automatically colored based on their Table type for quick identification.
Visual Builder (Blueprints) A construct-a-query interface.
- Drag & Drop: Drag nodes like
Filter,Selectonto the canvas. - Wire Connectivity: Connect nodes to build complex logic flows without writing a single line of code.
Analytics Dashboard Visual representation of data trends.
- Plot Integration: Uses the
(plot)command to render charts via JFreeChart.
Build System
- Standard Fat JAR:
mvn clean package - Native Windows Executable:
mvn -Pnative native:compile(Requires GraalVM)
Project Structure
com.lathadb.engine: Core logic and storage engine.com.lathadb.lang: Lisp Parser, AST, and SQL Transpiler.com.lathadb.ui: User Interface code (Swing/FlatLaf).com.lathadb.net: Networking, Server, and Replication logic.
Policy
- "Human Scalable Code": Code must be understandable by humans. No blind AI pasting without understanding and validation.