RpRelPyDBRelational Python

Documentation

15. Full Capability Checklist

Every supported feature of RelPyDB in one place — use it as a reference map or integration test checklist.

Schema

FeatureAPINotes
Create tablecreate_table(name)
Add column with typeadd_column(table, col, type)Supports int, float, str, bool, bytes, dict, list, AutoNumber
Nullable / defaultnullable=False, default=...
AutoNumber PKadd_column(..., AutoNumber, is_primary_key=True)Sequence continues after load
Composite PKset_primary_key(table, [col1, col2])
Foreign keyreferences="table.column", on_delete=...Supports RESTRICT, CASCADE, SET NULL
PII markeris_pii=TrueMetadata only; no runtime effect
Encrypted columnis_encrypted=TrueFernet encryption; blind index for equality search
Schema inspectiondescribe_table, describe_schema

Data operations

FeatureAPINotes
Insert one rowinsert(table, dict)Returns plaintext row with generated ID
Batch insertinsert_many(table, list[dict])Rebuilds indexes once after batch
Update with filterupdate(table, values, where=lambda)
Update entire tableupdate(table, values, allow_all=True)Explicit safety flag required
Delete with filterdelete(table, where=lambda)Applies FK on_delete rules
Delete entire tabledelete(table, allow_all=True)Explicit safety flag required
Rollback on failureAutomaticFailed insert_many / update / delete does not partially commit

Querying

FeatureAPI
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 checkscol(...).like(), .in_(), .between(), .is_null()
Logical AND / OR / NOT&, |, ~, AND(), OR(), NOT()

Joins

Join typeAPI
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 inferenceAutomatic when FK defined in schema
Explicit columnson=("left_col","right_col")
Chained joinsMultiple .join() calls

Grouping & aggregation

FeatureAPI
Group by single column.group_by("col")
Group by multiple columns.group_by("col1", "col2")
COUNTcount() / count("col")
SUMsum_("col")
AVGavg("col")
MIN / MAXmin_("col") / max_("col")
Filter on aggregated value.having(col("alias") > n)

Indexes

FeatureAPI
Single-column indexcreate_index(table, "col")
Composite indexcreate_index(table, ["col1","col2"])
Unique indexcreate_index(table, "col", unique=True)
Blind index (encrypted column)Automatic when column is is_encrypted=True
Incremental updateAfter every insert / update / delete
Rebuild after loadAutomatic on RelPy.load()

Exports

FormatFunction
Python list of dictsto_list()
JSON stringto_json()
pandas DataFrameto_pandas()
NumPy arrayto_numpy()
SQL INSERT statementsto_sql()
SQL DDL (CREATE TABLE)to_ddl()
Pretty-print to stdoutprint_table()

All export functions support column_name=, where_key=, and decrypt=True parameters.

Persistence

FeatureNotes
Save full state to JSONSchema, data, indexes, AutoNumber sequences, ciphertext
Load and continue mutatingAutoNumber sequence, indexes, and row positions restored
Views not persistedRe-register views after load
Encryption key not savedPass encryption_key= to RelPy.load()

Encryption

FeatureNotes
Fernet symmetric encryptionIndustry-standard AES-128 CBC + HMAC
Per-column encryptionis_encrypted=True on add_column
Masked exports by defaultShows [ENCRYPTED] without a key
Equality search on ciphertextBlind index (HMAC hash of plaintext)
Key never written to diskVerified at save/load time