phorm
library
Classes
Attributes
Interface for attribute filtering in queries (columns selection).
Batch
Abstract interface representing a batch of write operations.
BelongsTo
The inverse side of a relationship: this table holds the foreign key.
BIGINT
BIGINT type (e.g. 64-bit integer).
BLOB
BLOB binary large object type.
BOOLEAN
BOOLEAN type.
Collate
SQLite collation sequences.
Column
Standard column definition.
ColumnarQueryExecutor
Optional capability for DatabaseExecutor implementations that can
return SELECT results in columnar form.
ColumnarRows
SELECT results in columnar form: column names once, rows as value lists.
ColumnBase
Base class for all column definitions.
CustomSqlValidator
Generic SQL validator that accepts a raw SQL condition.
DatabaseExecutor
Abstract interface representing a database executor (either database connection or transaction).
DATE
DATE type.
DECIMAL
DECIMAL type with custom precision and scale.
DOUBLE
DOUBLE precision floating point type.
Factory <T extends Model >
Interface for model factories.
Used to generate mock data for testing or seeding.
HasMany
Relationship definitions
HasOne
A one-to-one relationship where the related table holds the foreign key.
ID
Primary key column.
IJsonValidator
JSON validation check (No SQL generation).
Includable
Base interface for specifying relationships to include in a query.
Index
Database index definition.
INTEGER
INTEGER type (e.g. 32-bit integer).
IPhormCore <T extends Model >
Contract implemented by PhormCore : query building and transactions.
IResult <T >
Base contract for query results.
ISqlValidator
CHECK constraint validation check (SQL generation).
IValidator
Base interface for check conditions (CHECK constraints).
Join
Alias of BelongsTo kept for query-join readability.
JSON
JSON type.
JSONB
PostgreSQL-specific SQL types.
ManyToMany
A many-to-many relationship resolved through a pivot table.
MigrationBuilder <T extends Model >
Fluent builder for creating migration sequences.
Provides type-safe methods for common migration operations.
Model
MODELS 🏗️
NoEscapeDialect
Default dialect that does not escape identifiers and uses positional '?' placeholders.
NUMERIC
SQLite-specific SQL types and helpers.
ParamIndex
Parameter index holder to track sequential placeholders during SQL compilation.
PhormColumn <T >
A typed representation of a database column.
Used for building type-safe queries.
PhormCondition
Represents a single SQL condition built from a column and an operator.
PhormConditionGroup
A group of PhormCondition s joined by AND or OR.
PhormConsoleLogger
A default colored console logger for PHORM.
PhormCore <T extends Model >
A flexible, generic CRUD service for SQLite databases in Flutter/Dart.
Supports soft deletes, automatic timestamps, batch operations,
advanced querying, and schema management. Extend this class for your models (T extends Model).
PhormDatabase
Abstract connection manager interface that is database-engine agnostic.
PhormDatabaseExecutor
Simple interface for database execution to avoid direct dependency on sqlite3
in the platform interface. This allows the generator to be pure Dart.
PhormLogger
Interface for PHORM logging.
PhormQuery <T extends Model >
A fluent query builder for PHORM models.
Allows chaining conditions, sorting, and pagination.
QueryEvent
A single executed database operation, reported to a QueryObserver .
REAL
REAL type.
ReferentialAction
Standard SQLite referential actions for foreign keys.
Used in Relationship for onDelete and onUpdate.
Relationship
Base class for relationship annotations between two models.
Result <T >
A plain list result.
ResultWithCount <T >
A result carrying the total row count alongside data .
Schema
Table-level schema configuration.
Seeder
Interface for database seeders.
Use this to populate the database with initial or test data.
SortBuilder
Fluent builder for SQL ORDER BY clauses. Supports ASC/DESC ordering by columns.
Validates column names. Use in PhormCore.readAll for sorted results.
SqlDialect
Interface defining SQL syntax generation rules for a specific database dialect.
SqlFunc
Annotation to mark a custom Dart function as a SQLite custom function.
SqlFunctionColumn <T >
A typed representation of an SQL function call on a column.
Kept in phorm because where_builder.dart needs it for column validation.
SqlFunctions
Helper class to apply registered SQL functions to database columns in a type-safe way.
SqlType
Abstract interface/class representing all SQL-compatible database data types.
SqlTypes
Standard SQLite type-name string constants.
Table <T extends Model >
Represents a fully generated table schema.
TableMigration <T extends Model >
Represents a single migration operation for a table.
TEXT
TEXT type.
TIME
TIME type.
TIMESTAMP
TIMESTAMP / DATETIME type.
ValueConverter <T , S >
Base class for converting between a Dart type T and a database-compatible type S.
VARCHAR
SQL data types available across all supported dialects
(SQLite, PostgreSQL, MySQL / MariaDB).
WhereBuilder
Fluent SQL WHERE clause builder with support for parameterized queries,
complex nested conditions, and safe column validation.
WhereBuilders
Factory functions for common WhereBuilder patterns
Functions
jsonDecode (String source , {Object ? reviver (Object ? key , Object ? value )? })
→ dynamic
Parses the string and returns the resulting Json object.
jsonEncode (Object ? object , {Object ? toEncodable (Object ? nonEncodable )? })
→ String
Converts object to a JSON string.
phormDecodeJson (Object ? value )
→ Object ?
Decodes a raw column value that may carry serialized JSON (nested object
columns, aggregated relationship columns): JSON-looking strings are parsed,
everything else is returned as-is. Mirrors the map-based read path.
Typedefs
ErrorCallback
= void Function(Object , StackTrace )
Callback signature for reporting errors together with their stack trace.
PhormRowBinder <T >
= T Function(List <Object ? > row ) Function(Map <String , int > columnIndex )
Positional row factory: given the result set's column name → index map
(resolved once per query), returns a per-row function that builds the
model by reading values directly from the positional List — no per-row
map construction or string-keyed lookups.
QueryObserver
= void Function(QueryEvent event )
Callback invoked for every database operation.
SortEntry
= ({String column , bool descending } )
One ORDER BY entry: a column and its direction.