Dext.Entity is a full-featured ORM for Delphi with support for multiple databases.
- Getting Started - First entity & context
- Entities & Mapping - Attributes and configuration
- Querying - Fluent query API
- Smart Properties - Type-safe queries without metadata classes
- JSON Queries - Query JSON/JSONB columns
- Specifications - Reusable query logic
- Relationships - 1:1, 1:N, Lazy Loading
- Migrations - Database schema lifecycle
- Scaffolding - Generate entities from DB
- Multi-Tenancy - SaaS data isolation
π¦ Examples:
- Orm.EntityDemo (Standard)
- Orm.EntityStyles (Comparison: POCO vs Smart Properties)
// 1. Define Entity
type
[Table('users')]
TUser = class
private
FId: Integer;
FName: string;
public
[PK, AutoInc]
property Id: Integer read FId write FId;
[Column('name')]
property Name: string read FName write FName;
end;
// 2. Create Context
type
TAppContext = class(TDbContext)
public
function Users: IDbSet<TUser>;
end;
// 3. Use It!
var
Ctx: TAppContext;
User: TUser;
begin
Ctx := TAppContext.Create(Connection, Dialect);
// Create
User := TUser.Create;
User.Name := 'John';
Ctx.Users.Add(User);
Ctx.SaveChanges;
// Read
User := Ctx.Users.Find(1);
// Query
var ActiveUsers := Ctx.Users
.Where(function(U: TUser): Boolean
begin
Result := U.Name.Contains('John');
end)
.ToList;
end;| Database | Status |
|---|---|
| PostgreSQL | β Stable |
| SQL Server | β Stable |
| SQLite | β Stable |
| Firebird | β Stable |
| MySQL / MariaDB | β Stable |
| Oracle | π‘ Beta |