Firebird¶
Firebird is an open-source relational database with a small footprint, well-suited for embedded and server deployments.
Unit: Trysil.Data.FireDAC.FirebirdSQL
Delphi Edition: Community
Setup¶
uses
Trysil.Data.FireDAC.FirebirdSQL;
TTFirebirdConnection.RegisterConnection(
'Main', 'localhost', 'SYSDBA', 'masterkey', '/path/to/database.fdb');
LConnection := TTFirebirdConnection.Create('Main');
try
LContext := TTContext.Create(LConnection);
try
// Use the context...
finally
LContext.Free;
end;
finally
LConnection.Free;
end;
Connection Pooling¶
Enable connection pooling for server applications:
Sequences¶
Firebird uses database sequences (generators) for primary key generation:
The sequence value is retrieved using NEXT VALUE FOR:
Map it to the entity:
[TTable('Persons')]
[TSequence('PersonsID')]
type
TPerson = class
strict private
[TPrimaryKey]
[TColumn('ID')]
FID: TTPrimaryKey;
// ...
end;