Skip to main content

Rust-powered embedded database for Python

Project description

RSN DB

A Rust-powered embedded database with a personality.

rust python security

Features

  • Insane Safety & Security: AES-GCM Encryption, Zstd Compression, and SHA-256 Checksums.
  • Dynamic Personality: Choose your experience—Professional, Friendly, or Snarky with richer reactions, achievements, and batch summaries.
  • Interactive CLI: Just type rsn and get to work.
  • Smart Data Handling: Constraints, Aliases, Batch Operations, and Smart Type Coercion.
  • Command UX Features: Talk to your data with FIND, inspect schemas with DESCRIBE, and review recent activity via HISTORY.

Interactive Session Demo

Snarky Mode Activation

Caption: Setting up RSN DB for the first time and enabling full snark mode.

$ rsn
Select mode:
  [1] Professional (clean, minimal output)
  [2] Friendly     (helpful with personality)
  [3] Snarky       (full commentary enabled)

Choice (default: 1): 3
Remember this choice? (y/n): y

✓ Snarky mode enabled.
  Don't say I didn't warn you.

rsn>

Natural Language Query

Caption: Using the FIND command to translate complex questions into database queries.

rsn> FIND users older than Bob who follow someone
⚙ Translating...
  Interpreted as: READ users WHERE age > (SELECT age FROM users WHERE name = "Bob") AND has_outbound_edge("FOLLOWS")
Is that it?
Y for yes, N or blank for no
r>y
╭── Results ────────────────────╮
│  • Alice (30)                 │
│  • Charlie (35)               │
╰───────────────────────────────╯

Batch Operations & Achievement

Caption: Executing a fast batch of inserts and getting roasted/rewarded by the engine.

rsn> BATCH
batch> INSERT users (name: "User1", age: 20)
batch> INSERT users (name: "User2", age: 21)
batch> INSERT users (name: "User3", age: 22)
batch> COMMIT

✓ Batch executed: 3 operations.
  (Wow! You're fast! Very hard work. Good job. My grandmother can't do that. Not that I have one, since I'm a robot.)

... (after 50 perfect commands) ...

[SYSTEM]: Achievement unlocked: "Actually Competent"
[SYSTEM]: Updating user classification from "Hopeless" to "Occasionally Capable"

Quickstart

Installation

pip install rsn_db

CLI Usage

rsn

Library Usage

from rsn_db import Database

# The library is all business. No snark here.
db = Database(storage_path="my_data.rsn", encryption_key="secret-key")
db.create_table("users", {"name": {"type": "string", "required": True}})
db.insert("users", {"name": "Alice"})

Security & Safety

RSN DB takes your data seriously (even if it doesn't take you seriously).

  • Encryption at Rest: AES-256-GCM for persisted payloads when encryption_key is set.
  • Integrity: SHA-256 checksums detect persisted file tampering/corruption before decode.
  • Identifier Safety: strict identifier validation for table/field names used in generated SQLite SQL.
  • Path Safety: import/export paths must be relative and cannot contain parent traversal segments or absolute/prefixed roots. Database storage paths reject traversal segments and invalid prefixes.
  • DoS Guardrails: hard limits for command length, batch operation count, ingest payload size, JSONL import file size, and JSONL line count.

For operational guidance and security limits, see documentation/security.md.


License

MIT

GraphRAG (New in v0.2.0)

RSN DB now includes a built-in GraphRAG engine for knowledge retrieval without heavy LLMs. Usage:

db.ingest("Large text document...", source="my_doc")
print(db.graph_query("What are the key entities?"))

Or via SQL:

INGEST "My interesting text..."
GRAPH_QUERY Who is related to what?

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rsn_db-0.2.1-cp312-cp312-manylinux_2_34_x86_64.whl (2.6 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

File details

Details for the file rsn_db-0.2.1-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for rsn_db-0.2.1-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 d1922e3bcd68c366d623b15e727d5655570552796ab48bc04e28bd298e59bc59
MD5 5a4ae64f53e30c2ca1418f7b4e757936
BLAKE2b-256 550037ba56201cadd9a55775adc823a4d2bb0b08c96c7a984ee0196fd54dd9b6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page