Database (Porm)

Pionia includes Porm (Pionia ORM) — a Medoo-inspired query builder, not a full ORM. There are no models or migrations in the framework; you work with tables, arrays, and a fluent API.

Quick start

// Global helpers (recommended)
$row = table('users')->get(1);
$rows = table('users')->filter(['active' => 1])->limit(10)->all();

// Named connection from environment/settings.ini
table('orders', null, 'db_pgsql')->save(['total' => 99]);

Porm is built into your Pionia app. Use table() or db() — not legacy Porm\Porm::from() patterns from older tutorials.

Guide map

TopicPage
Configuration & entry pointsGetting started
CRUD & readsMaking queries
filter(), orderBy, limitFiltering
WHERE operators & clause keysWHERE DSL reference
Joins & aliasesRelationships & joins
count, sum, Agg builderAggregation
PaginationCore & list APIsPagination
Multi-DB & poolingConnections
Transactions & raw SQLTransactions & raw SQL
chunk, random, explainPerformance
Method cheat sheetAPI reference

Query modes

table('users')
  ├─ Direct mode   → get(), save(), update(), delete(), has(), random(), …
  ├─ filter()      → Builder (where, orderBy, limit, all, count, …)
  └─ join()        → Join (left, inner, right, full, all, count, random, …)

After filter() or join(), table-level write methods (save, get, etc.) are not available on the same chain — finish with all(), get(), or count() on the builder.