HeliosDB Nano Protocol Server - Quick Start Guide
HeliosDB Nano Protocol Server - Quick Start Guide
Overview
HeliosDB Nano now supports multi-protocol server mode, allowing clients to connect via Oracle TNS protocol (PostgreSQL coming soon).
Installation
Build from source:
cd /home/claude/HeliosDB Nanocargo build --releaseThe binary will be at target/release/heliosdb-nano.
Starting the Server
Basic Start
heliosdb-nano startThis will:
- Create data directory at
./heliosdb-data - Start Oracle TNS server on
127.0.0.1:1521 - Display “NOT YET IMPLEMENTED” for PostgreSQL protocol
Custom Data Directory
heliosdb-nano start --data-dir /var/lib/heliosdbListen on All Interfaces
heliosdb-nano start --listen 0.0.0.0Full Example
# Start server with custom settingsheliosdb-nano start \ --data-dir /var/lib/heliosdb \ --listen 0.0.0.0 \ --port 5432
# You'll see output like:# === HeliosDB Nano Multi-Protocol Server ===# Data directory: "/var/lib/heliosdb"# Database initialized successfully# Protocol Configuration:# - Oracle TNS: 0.0.0.0:1521 (ENABLED)# - PostgreSQL: 0.0.0.0:5432 (NOT YET IMPLEMENTED)# ...# Starting Oracle TNS server on 0.0.0.0:1521# Oracle TNS server listening on 0.0.0.0:1521Connecting to the Server
Using Oracle SQL*Plus
sqlplus username/password@//localhost:1521/HELIOSDBExample session:
SQL> CREATE TABLE users (id INT, name TEXT);Table created.
SQL> INSERT INTO users VALUES (1, 'Alice');1 row inserted.
SQL> SELECT * FROM users; ID NAME---------- ---------- 1 AliceUsing Oracle SQLcl
sql username/password@//localhost:1521/HELIOSDBUsing Python (cx_Oracle)
import cx_Oracle
# Connect to HeliosDB Nanoconn = cx_Oracle.connect( "username", "password", "localhost:1521/HELIOSDB")
# Create cursorcursor = conn.cursor()
# Execute SQLcursor.execute("CREATE TABLE users (id INT, name TEXT)")cursor.execute("INSERT INTO users VALUES (1, 'Alice')")
# Query datacursor.execute("SELECT * FROM users")for row in cursor: print(row)
# Close connectioncursor.close()conn.close()Using Java (JDBC)
import java.sql.*;
public class HeliosDBExample { public static void main(String[] args) throws SQLException { // Connect to HeliosDB Nano String url = "jdbc:oracle:thin:@localhost:1521:HELIOSDB"; Connection conn = DriverManager.getConnection( url, "username", "password" );
// Execute SQL Statement stmt = conn.createStatement(); stmt.execute("CREATE TABLE users (id INT, name TEXT)"); stmt.execute("INSERT INTO users VALUES (1, 'Alice')");
// Query data ResultSet rs = stmt.executeQuery("SELECT * FROM users"); while (rs.next()) { System.out.println( "ID: " + rs.getInt("id") + ", Name: " + rs.getString("name") ); }
// Close rs.close(); stmt.close(); conn.close(); }}Supported SQL (Oracle Dialect)
HeliosDB Nano translates Oracle SQL to its internal format:
Tables
-- Create tableCREATE TABLE users ( id NUMBER PRIMARY KEY, name VARCHAR2(100), email VARCHAR2(255), created_date DATE);
-- Insert dataINSERT INTO users VALUES (1, 'Alice', 'alice@example.com', SYSDATE);
-- Query dataSELECT * FROM users;SELECT * FROM users WHERE id = 1;
-- Update dataUPDATE users SET email = 'newemail@example.com' WHERE id = 1;
-- Delete dataDELETE FROM users WHERE id = 1;
-- Drop tableDROP TABLE users;Oracle-Specific Functions (Translated)
-- SYSDATE → CURRENT_TIMESTAMPSELECT SYSDATE FROM DUAL;
-- NVL() → COALESCE()SELECT NVL(column, 'default') FROM table;
-- DECODE() → CASE WHENSELECT DECODE(status, 'A', 'Active', 'I', 'Inactive') FROM users;
-- Dual table emulationSELECT 1 + 1 FROM DUAL;Vector Search (HeliosDB Extension)
-- Create table with vector columnCREATE TABLE embeddings ( id INT, content TEXT, embedding VECTOR(768));
-- Insert vector dataINSERT INTO embeddings VALUES ( 1, 'Hello world', '[0.1, 0.2, 0.3, ...]'::VECTOR);
-- Vector similarity searchSELECT * FROM embeddingsORDER BY embedding <-> '[0.1, 0.2, 0.3, ...]'::VECTORLIMIT 10;Stopping the Server
Press Ctrl+C to gracefully shut down:
^CReceived shutdown signal (Ctrl+C)Oracle server shutting downWaiting for protocol servers to shut down...All protocol servers shut down successfullyServer shutdown completeOther Modes
REPL Mode (Interactive)
heliosdb-nano replInteractive SQL shell:
HeliosDB Nano v2.0.0 - Interactive ShellType 'help' for help, 'exit' to quit
helios> CREATE TABLE users (id INT, name TEXT);OK (1 row affected)
helios> INSERT INTO users VALUES (1, 'Alice');OK (1 row inserted)
helios> SELECT * FROM users;+----+-------+| id | name |+----+-------+| 1 | Alice |+----+-------+1 row
helios> exitGoodbye!Initialize New Database
heliosdb-nano init /path/to/databaseTroubleshooting
Port Already in Use
Error: “Failed to bind to 127.0.0.1:1521”
Solution: Another process is using port 1521. Either stop that process or use a different port:
# Find what's using the portlsof -i :1521
# Use a different port (requires Oracle server modification)# Currently port is hardcoded to 1521Connection Refused
Error: Client cannot connect
Solution:
- Verify server is running:
ps aux | grep heliosdb-nano - Check if firewall is blocking port 1521
- Try connecting from localhost first
- Check server logs for errors
PostgreSQL Client Won’t Connect
Error: psql or other PostgreSQL clients fail to connect
Reason: PostgreSQL wire protocol is not yet implemented. Currently only Oracle TNS protocol works.
Solution: Use Oracle client tools or wait for PostgreSQL protocol implementation.
File Locations
After starting the server, you’ll find:
./heliosdb-data/ # Data directory├── CURRENT # RocksDB current version├── IDENTITY # Database identity├── LOCK # Lock file├── LOG # RocksDB log├── MANIFEST-* # RocksDB manifest├── OPTIONS-* # RocksDB options└── *.sst # Data files (SST tables)Environment Variables
# Set log levelexport RUST_LOG=infoexport RUST_LOG=debug # More verboseexport RUST_LOG=trace # Most verbose
# Start server with loggingRUST_LOG=debug heliosdb-nano startNext Steps
- Read full documentation:
/home/claude/HeliosDB Nano/docs/PROTOCOL_INTEGRATION_COMPLETE.md - Review Oracle protocol details:
/home/claude/HeliosDB Nano/src/protocols/oracle/ - Check adapter layer:
/home/claude/HeliosDB Nano/src/protocols/adapters/ - Run tests:
cargo test --test protocol_integration_test
Support
For issues or questions:
- Check documentation in
/home/claude/HeliosDB Nano/docs/ - Review test files for usage examples
- Examine source code in
/home/claude/HeliosDB Nano/src/
Limitations (Current Version)
- PostgreSQL Protocol: Not yet implemented (shows “NOT YET IMPLEMENTED”)
- Oracle Features: Basic SQL only (no PL/SQL, packages, procedures)
- Authentication: Basic auth only (no Kerberos, SSL)
- Replication: Not yet available
- Clustering: Single-node only
These features will be added in future releases.