Skip to content

HeliosDB Nano v3.0.1 - Testing Guide

HeliosDB Nano v3.0.1 - Testing Guide

Quick reference for running tests and using the new daemon mode with REAL/FLOAT support.


Quick Start

Start Daemon Server

Terminal window
# Start daemon on default port 5432
./target/release/heliosdb-nano start --daemon \
--port 5432 \
--listen 127.0.0.1 \
--data-dir ./heliosdb-data \
--pid-file ./heliosdb.pid

Check Server Status

Terminal window
./target/release/heliosdb-nano status --pid-file ./heliosdb.pid

Connect with psql

Terminal window
psql -h 127.0.0.1 -p 5432 -U postgres -d postgres

Stop Server

Terminal window
./target/release/heliosdb-nano stop --pid-file ./heliosdb.pid

Test Suite

Run All Tests

Terminal window
bash test-scripts/test_comprehensive.sh

This runs the full test suite including:

  • Daemon initialization and management
  • REPL mode operations
  • REAL/FLOAT data type support
  • PostgreSQL client compatibility
  • SSL negotiation

Run Individual Tests

Phase 1: Daemon Mode Setup

Terminal window
bash test-scripts/test_daemon_setup.sh

Tests:

  • Server starts in background
  • PID file creation
  • Process verification
  • Port binding

Phase 2: REPL Mode Tests

Terminal window
bash test-scripts/test_repl_basic.sh
bash test-scripts/test_repl_floats.sh

test_repl_basic.sh tests:

  • CREATE TABLE
  • INSERT operations
  • SELECT queries
  • Meta commands (\d, \dt, \telemetry)

test_repl_floats.sh tests:

  • REAL data type (32-bit float)
  • FLOAT data type (64-bit float)
  • DOUBLE PRECISION data type
  • Mixed numeric types

Phase 3: PostgreSQL Client Tests

Terminal window
bash test-scripts/test_psql_basic.sh
bash test-scripts/test_psql_floats.sh
bash test-scripts/test_ssl_negotiation.sh

test_psql_basic.sh tests:

  • PostgreSQL client connectivity
  • CREATE TABLE via psql
  • INSERT and SELECT via psql
  • Table listing via psql

test_psql_floats.sh tests:

  • REAL type operations with psql
  • FLOAT operations with psql
  • Arithmetic with REAL values

test_ssl_negotiation.sh tests:

  • SSL request handling
  • Connection fallback to plain
  • Certificate-less operation

Phase 4: Daemon Management

Terminal window
bash test-scripts/test_daemon_management.sh

Tests:

  • Status command
  • Graceful stop
  • Restart functionality
  • Process verification

Test Output Files

All test results are saved in test-results/:

FileContent
comprehensive_test_log.txtFull test suite execution log
TEST_TRACKING_v3.0.1.mdDetailed test tracking
TEST_SUMMARY_v3.0.1.mdAuto-generated summary
FINAL_TEST_REPORT_v3.0.1.mdComprehensive test report
repl_basic_output.txtREPL basic operations output
repl_floats_output.txtREPL float types output

Feature Examples

Using REAL Data Type (32-bit float)

CREATE TABLE products (
id INT,
name TEXT,
price REAL
);
INSERT INTO products VALUES (1, 'Widget', 9.99);
INSERT INTO products VALUES (2, 'Gadget', 19.99);
SELECT * FROM products WHERE price > 15.0;

Using FLOAT Data Type (64-bit float)

CREATE TABLE measurements (
id INT,
value FLOAT,
precision DOUBLE PRECISION
);
INSERT INTO measurements VALUES (1, 3.14159, 2.71828182845);
SELECT * FROM measurements;

Mixed Numeric Types

CREATE TABLE financial_data (
transaction_id INT,
amount REAL,
tax FLOAT,
total DOUBLE PRECISION
);
INSERT INTO financial_data VALUES (1, 100.50, 10.05, 110.55);
SELECT * FROM financial_data;

Performance Tips

For Development

Use REPL mode for quick testing:

Terminal window
./target/release/heliosdb-nano repl

For Production

Use daemon mode with proper configuration:

Terminal window
./target/release/heliosdb-nano start --daemon \
--port 5432 \
--listen 0.0.0.0 \
--data-dir /var/lib/heliosdb \
--pid-file /var/run/heliosdb.pid

Performance Characteristics

  • REAL (32-bit): Fast, 4 bytes storage
  • FLOAT (64-bit): Slightly slower, 8 bytes storage
  • SELECT operations: < 1ms typical
  • INSERT operations: 3-5ms typical

Troubleshooting

Port Already in Use

Terminal window
# Use a different port
./target/release/heliosdb-nano start --daemon --port 6543

Daemon Not Running

Terminal window
# Check status
./target/release/heliosdb-nano status --pid-file ./heliosdb.pid
# View recent logs
tail -50 ./heliosdb-daemon-data/server.log

psql Connection Issues

Terminal window
# If SSL negotiation fails, it should automatically fall back
# If issues persist, check server status first
./target/release/heliosdb-nano status --pid-file ./heliosdb.pid

Integration with CI/CD

Add to your CI/CD pipeline:

#!/bin/bash
set -e
# Build
cargo build --release
# Run tests
bash test-scripts/test_daemon_setup.sh
bash test-scripts/test_repl_basic.sh
bash test-scripts/test_repl_floats.sh
echo "All tests passed!"

Data Type Reference

TypeSizeRangePrecisionUse Case
INT4 bytes-2B to +2BExactCounts, IDs
TEXTVariableN/AN/ANames, descriptions
REAL4 bytes±3.4e38~7 digitsPrices, ratings
FLOAT8 bytes±1.7e308~15 digitsScientific data
DOUBLE PRECISION8 bytes±1.7e308~15 digitsHigh precision
TIMESTAMP8 bytesWide rangeN/ATimestamps

Common Operations

Create and Populate a Products Table

Terminal window
# Via REPL
echo "
CREATE TABLE products (
id INT,
name TEXT,
price REAL,
rating FLOAT
);
INSERT INTO products VALUES (1, 'Widget', 9.99, 4.5);
INSERT INTO products VALUES (2, 'Gadget', 19.99, 4.8);
SELECT * FROM products;
" | ./target/release/heliosdb-nano repl

Via psql

Terminal window
psql -h 127.0.0.1 -p 5432 -U postgres -d postgres << 'EOF'
CREATE TABLE products (
id INT,
name TEXT,
price REAL,
rating FLOAT
);
INSERT INTO products VALUES (1, 'Widget', 9.99, 4.5);
INSERT INTO products VALUES (2, 'Gadget', 19.99, 4.8);
SELECT * FROM products;
EOF

Next Steps

  1. Review Results: Check test-results/FINAL_TEST_REPORT_v3.0.1.md
  2. Run Tests: Execute bash test-scripts/test_comprehensive.sh
  3. Deploy: Use daemon mode for production
  4. Monitor: Check status regularly with ./heliosdb-nano status
  5. Backup: Regularly backup your data directory

Support

For issues or questions:

  • Review FINAL_TEST_REPORT_v3.0.1.md for detailed test results
  • Check test output files in test-results/
  • Review NEW_FEATURES_v3.0.1.md for feature documentation

Last Updated: 2025-12-07 Version: 3.0.1 Status: ✅ Production Ready