Documentation
15. Full Capability Checklist
Every supported feature of RelPyDB in one place — use it as a reference map or integration test checklist.
Schema
| Feature | API | Notes |
| Create table | create_table(name) | |
| Add column with type | add_column(table, col, type) | Supports int, float, str, bool, bytes, dict, list, AutoNumber |
| Nullable / default | nullable=False, default=... | |
| AutoNumber PK | add_column(..., AutoNumber, is_primary_key=True) | Sequence continues after load |
| Composite PK | set_primary_key(table, [col1, col2]) | |
| Foreign key | references="table.column", on_delete=... | Supports RESTRICT, CASCADE, SET NULL |
| PII marker | is_pii=True | Metadata only; no runtime effect |
| Encrypted column | is_encrypted=True | Fernet encryption; blind index for equality search |
| Schema inspection | describe_table, describe_schema | |
Data operations
| Feature | API | Notes |
| Insert one row | insert(table, dict) | Returns plaintext row with generated ID |
| Batch insert | insert_many(table, list[dict]) | Rebuilds indexes once after batch |
| Update with filter | update(table, values, where=lambda) | |
| Update entire table | update(table, values, allow_all=True) | Explicit safety flag required |
| Delete with filter | delete(table, where=lambda) | Applies FK on_delete rules |
| Delete entire table | delete(table, allow_all=True) | Explicit safety flag required |
| Rollback on failure | Automatic | Failed insert_many / update / delete does not partially commit |
Querying
| Feature | API |
| Filter | .where(col("x") == v) |
| Project columns | .select("col1", "col2") |
| Sort ascending / descending | .order_by("col", descending=True) |
| Multi-column sort | .order_by(("col1","asc"),("col2","desc")) |
| Limit / offset | .limit(n).offset(n) |
| Distinct | .distinct() |
| Equality, comparison, LIKE, IN, BETWEEN, NULL checks | col(...).like(), .in_(), .between(), .is_null() |
| Logical AND / OR / NOT | &, |, ~, AND(), OR(), NOT() |
Joins
| Join type | API |
| Inner (default) | .join("t") / .inner_join("t") |
| Left outer | .left_join("t") |
| Right outer | .right_join("t") |
| Full outer | .full_join("t") |
| Cross (Cartesian) | .cross_join("t") |
| Natural | .natural_join("t") |
| FK inference | Automatic when FK defined in schema |
| Explicit columns | on=("left_col","right_col") |
| Chained joins | Multiple .join() calls |
Grouping & aggregation
| Feature | API |
| Group by single column | .group_by("col") |
| Group by multiple columns | .group_by("col1", "col2") |
| COUNT | count() / count("col") |
| SUM | sum_("col") |
| AVG | avg("col") |
| MIN / MAX | min_("col") / max_("col") |
| Filter on aggregated value | .having(col("alias") > n) |
Indexes
| Feature | API |
| Single-column index | create_index(table, "col") |
| Composite index | create_index(table, ["col1","col2"]) |
| Unique index | create_index(table, "col", unique=True) |
| Blind index (encrypted column) | Automatic when column is is_encrypted=True |
| Incremental update | After every insert / update / delete |
| Rebuild after load | Automatic on RelPy.load() |
Exports
| Format | Function |
| Python list of dicts | to_list() |
| JSON string | to_json() |
| pandas DataFrame | to_pandas() |
| NumPy array | to_numpy() |
| SQL INSERT statements | to_sql() |
| SQL DDL (CREATE TABLE) | to_ddl() |
| Pretty-print to stdout | print_table() |
All export functions support column_name=, where_key=, and decrypt=True parameters.
Persistence
| Feature | Notes |
| Save full state to JSON | Schema, data, indexes, AutoNumber sequences, ciphertext |
| Load and continue mutating | AutoNumber sequence, indexes, and row positions restored |
| Views not persisted | Re-register views after load |
| Encryption key not saved | Pass encryption_key= to RelPy.load() |
Encryption
| Feature | Notes |
| Fernet symmetric encryption | Industry-standard AES-128 CBC + HMAC |
| Per-column encryption | is_encrypted=True on add_column |
| Masked exports by default | Shows [ENCRYPTED] without a key |
| Equality search on ciphertext | Blind index (HMAC hash of plaintext) |
| Key never written to disk | Verified at save/load time |