781 |
|
initially prepared. The interface is returned from the IAttachment interface. |
782 |
|
} |
783 |
|
|
784 |
+ |
TStatementFlag = (stHasCursor,stRepeatExecute,stScrollable); |
785 |
+ |
TStatementFlags = set of TStatementFlag; |
786 |
+ |
|
787 |
|
IStatement = interface |
788 |
|
['{a260576d-a07d-4a66-b02d-1b72543fd7cf}'] |
789 |
|
function GetMetaData: IMetaData; {Output Metadata} |
795 |
|
function GetSQLText: AnsiString; |
796 |
|
function GetProcessedSQLText: AnsiString; |
797 |
|
function GetSQLDialect: integer; |
798 |
+ |
function GetFlags: TStatementFlags; |
799 |
|
function IsPrepared: boolean; |
800 |
|
function HasBatchMode: boolean; |
801 |
|
function IsInBatchMode: boolean; |
825 |
|
property SQLStatementType: TIBSQLStatementTypes read GetSQLStatementType; |
826 |
|
end; |
827 |
|
|
828 |
+ |
ITrInfoItem = interface |
829 |
+ |
['{41455e1a-f84e-4e26-aff0-1a78e8b69cfe}'] |
830 |
+ |
function getItemType: byte; |
831 |
+ |
function getSize: integer; |
832 |
+ |
function getAsString: AnsiString; |
833 |
+ |
function getAsInteger: int64; |
834 |
+ |
procedure DecodeTraIsolation(var IsolationType, RecVersion: byte); |
835 |
+ |
end; |
836 |
+ |
|
837 |
+ |
{ ITrInformation } |
838 |
+ |
|
839 |
+ |
ITrInformation = interface |
840 |
+ |
['{e6ea4a52-c1a1-44ba-9609-c8bcc7cba7b2}'] |
841 |
+ |
function GetCount: integer; |
842 |
+ |
function GetItem(index: integer): ITrInfoItem; |
843 |
+ |
function Find(ItemType: byte): ITrInfoItem; |
844 |
+ |
procedure PrintBuf; {can be used to print buffer in hex for debugging} |
845 |
+ |
property Count: integer read GetCount; |
846 |
+ |
property Items[index: integer]: ITrInfoItem read getItem; default; |
847 |
+ |
end; |
848 |
+ |
|
849 |
|
{Transaction Parameter Block: (TPB) |
850 |
|
|
851 |
|
The TPB provides the parameters used when starting a transaction. It is allocated |
859 |
|
|
860 |
|
ITPBItem = interface(IParameterBlockItemWithTypeName) |
861 |
|
['{544c1f2b-7c12-4a87-a4a5-face7ea72671}'] |
837 |
– |
function getParamTypeName: AnsiString; |
862 |
|
end; |
863 |
|
|
864 |
|
ITPB = interface(IParameterBlockWithTypeNames<ITPBItem>) |
865 |
|
['{7369b0ff-defe-437b-81fe-19b211d42d25}'] |
866 |
+ |
function AsText: AnsiString; |
867 |
|
end; |
868 |
|
|
869 |
|
{The ITransactionAction interface provides access to a Transaction once it |
882 |
|
function getTPB: ITPB; |
883 |
|
procedure Start(DefaultCompletion: TTransactionCompletion=taCommit); |
884 |
|
function GetInTransaction: boolean; |
885 |
+ |
function GetIsReadOnly: boolean; |
886 |
+ |
function GetTransactionID: integer; |
887 |
+ |
function GetJournalingActive(attachment: IAttachment): boolean; |
888 |
+ |
function GetDefaultCompletion: TTransactionCompletion; |
889 |
|
procedure PrepareForCommit; {Two phase commit - stage 1} |
890 |
|
procedure Commit(Force: boolean=false); |
891 |
|
procedure CommitRetaining; |
894 |
|
procedure RollbackRetaining; |
895 |
|
function GetAttachmentCount: integer; |
896 |
|
function GetAttachment(index: integer): IAttachment; |
897 |
+ |
function GetTrInformation(Requests: array of byte): ITrInformation; overload; |
898 |
+ |
function GetTrInformation(Request: byte): ITrInformation; overload; |
899 |
+ |
function GetTransactionName: AnsiString; |
900 |
+ |
procedure SetTransactionName(aValue: AnsiString); |
901 |
|
property InTransaction: boolean read GetInTransaction; |
902 |
+ |
property TransactionName: AnsiString read GetTransactionName write SetTransactionName; |
903 |
|
end; |
904 |
|
|
905 |
|
{ The IEvents Interface is used to handle events from a single database. The |
1062 |
|
['{e676067b-1cf4-4eba-9256-9724f57e0d16}'] |
1063 |
|
end; |
1064 |
|
|
1065 |
+ |
{Journaling options. Default is [joReadWriteTransactions,joModifyQueries] } |
1066 |
+ |
|
1067 |
+ |
TJournalOption = (joReadOnlyTransactions, joReadWriteTransactions, |
1068 |
+ |
joModifyQueries, joReadOnlyQueries); |
1069 |
+ |
|
1070 |
+ |
TJournalOptions = set of TJournalOption; |
1071 |
+ |
|
1072 |
|
{The IAttachment interface provides access to a Database Connection. It may be |
1073 |
|
used to: |
1074 |
|
|
1106 |
|
procedure Disconnect(Force: boolean=false); |
1107 |
|
function IsConnected: boolean; |
1108 |
|
procedure DropDatabase; |
1109 |
< |
function StartTransaction(TPB: array of byte; DefaultCompletion: TTransactionCompletion=taCommit): ITransaction; overload; |
1110 |
< |
function StartTransaction(TPB: ITPB; DefaultCompletion: TTransactionCompletion=taCommit): ITransaction; overload; |
1109 |
> |
function StartTransaction(TPB: array of byte; |
1110 |
> |
DefaultCompletion: TTransactionCompletion=taCommit; |
1111 |
> |
aName: AnsiString=''): ITransaction; overload; |
1112 |
> |
function StartTransaction(TPB: ITPB; |
1113 |
> |
DefaultCompletion: TTransactionCompletion=taCommit; |
1114 |
> |
aName: AnsiString=''): ITransaction; overload; |
1115 |
|
procedure ExecImmediate(transaction: ITransaction; sql: AnsiString; SQLDialect: integer); overload; |
1116 |
|
procedure ExecImmediate(TPB: array of byte; sql: AnsiString; SQLDialect: integer); overload; |
1117 |
|
procedure ExecImmediate(transaction: ITransaction; sql: AnsiString); overload; |
1182 |
|
|
1183 |
|
{Database Information} |
1184 |
|
function GetSQLDialect: integer; |
1185 |
+ |
function GetAttachmentID: integer; |
1186 |
|
function GetBlobMetaData(Transaction: ITransaction; tableName, columnName: AnsiString): IBlobMetaData; |
1187 |
|
function GetArrayMetaData(Transaction: ITransaction; tableName, columnName: AnsiString): IArrayMetaData; |
1188 |
|
function GetDBInformation(Requests: array of byte): IDBInformation; overload; |
1198 |
|
function HasActivity: boolean; |
1199 |
|
function HasDecFloatSupport: boolean; |
1200 |
|
function HasBatchMode: boolean; |
1201 |
+ |
function HasScollableCursors: boolean; |
1202 |
+ |
function HasTable(aTableName: AnsiString): boolean; |
1203 |
|
|
1204 |
|
{Character Sets} |
1205 |
|
function HasDefaultCharSet: boolean; |
1215 |
|
{Time Zone Database} |
1216 |
|
function GetTimeZoneServices: ITimeZoneServices; |
1217 |
|
function HasTimeZoneSupport: boolean; |
1218 |
+ |
|
1219 |
+ |
{Client side Journaling} |
1220 |
+ |
function JournalingActive: boolean; |
1221 |
+ |
function GetJournalOptions: TJournalOptions; |
1222 |
+ |
function StartJournaling(aJournalLogFile: AnsiString): integer; overload; |
1223 |
+ |
function StartJournaling(aJournalLogFile: AnsiString; Options: TJournalOptions): integer; overload; |
1224 |
+ |
procedure StopJournaling(RetainJournal: boolean); |
1225 |
|
end; |
1226 |
|
|
1227 |
|
TProtocolAll = (TCP, SPX, NamedPipe, Local, inet, inet4, inet6, wnet, xnet, unknownProtocol); |
1390 |
|
{Start Transaction against multiple databases} |
1391 |
|
function AllocateTPB: ITPB; |
1392 |
|
function StartTransaction(Attachments: array of IAttachment; |
1393 |
< |
TPB: array of byte; DefaultCompletion: TTransactionCompletion=taCommit): ITransaction; overload; |
1393 |
> |
TPB: array of byte; DefaultCompletion: TTransactionCompletion=taCommit; |
1394 |
> |
aName: AnsiString=''): ITransaction; overload; |
1395 |
|
function StartTransaction(Attachments: array of IAttachment; |
1396 |
< |
TPB: ITPB; DefaultCompletion: TTransactionCompletion=taCommit): ITransaction; overload; |
1396 |
> |
TPB: ITPB; DefaultCompletion: TTransactionCompletion=taCommit; |
1397 |
> |
aName: AnsiString=''): ITransaction; overload; |
1398 |
|
|
1399 |
|
{Service Manager} |
1400 |
|
function HasServiceAPI: boolean; |
1413 |
|
function HasLocalTZDB: boolean; |
1414 |
|
function HasTimeZoneSupport: boolean; |
1415 |
|
function HasExtendedTZSupport: boolean; |
1359 |
– |
function HasScollableCursors: boolean; |
1416 |
|
|
1417 |
|
{Firebird 3 API} |
1418 |
|
function HasMasterIntf: boolean; |
1475 |
|
|
1476 |
|
function LoadFBLibrary(aLibPathName: string): IFirebirdLibrary; |
1477 |
|
|
1478 |
+ |
{$if not declared(NULL)} {Needed for Delphi} |
1479 |
+ |
function Null: Variant; // Null standard constant |
1480 |
+ |
{$define NEEDNULLFUNCTION} |
1481 |
+ |
{$ifend} |
1482 |
|
|
1483 |
|
implementation |
1484 |
|
|
1485 |
< |
uses FBClientAPI |
1485 |
> |
uses FBClientAPI {$if not declared(NULL)}, Variants {$ifend} |
1486 |
|
{$IFDEF USELEGACYFIREBIRDAPI}, FB25ClientAPI {$ENDIF} |
1487 |
|
{$IFDEF USEFIREBIRD3API}, FB30ClientAPI {$ENDIF}; |
1488 |
|
|
1587 |
|
FIBErrorCode := AIBErrorCode; |
1588 |
|
end; |
1589 |
|
|
1590 |
+ |
{$ifdef NEEDNULLFUNCTION} |
1591 |
+ |
function Null: Variant; // Null standard constant |
1592 |
+ |
begin |
1593 |
+ |
VarClearProc(TVarData(Result)); |
1594 |
+ |
TVarData(Result).VType := varnull; |
1595 |
+ |
end; |
1596 |
+ |
{$endif} |
1597 |
|
|
1598 |
|
initialization |
1599 |
|
FDefaultFBLibrary := nil; |