ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/branches/journaling/fbintf/IB.pas
(Generate patch)

Comparing:
ibx/trunk/fbintf/IB.pas (file contents), Revision 350 by tony, Wed Oct 20 14:58:56 2021 UTC vs.
ibx/branches/journaling/fbintf/IB.pas (file contents), Revision 364 by tony, Tue Dec 7 13:30:09 2021 UTC

# Line 134 | Line 134 | uses
134   const
135    {Interface version information}
136    FBIntf_Major = 1;
137 <  FBIntf_Minor = 3;
138 <  FBIntf_Release = 2;
139 <  FBIntf_Version = '1.3.2';
137 >  FBIntf_Minor = 4;
138 >  FBIntf_Release = 0;
139 >  FBIntf_Version = '1.4.0';
140  
141   const
142    {DPB, TPB and SPB Parameter Block Name Prefixes}
# Line 781 | Line 781 | type
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}
# Line 792 | Line 795 | type
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;
# Line 821 | Line 825 | type
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
# Line 834 | Line 859 | type
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
# Line 857 | Line 882 | type
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;
# Line 865 | Line 894 | type
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
# Line 1028 | Line 1062 | type
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  
# Line 1065 | Line 1106 | type
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;
# Line 1137 | Line 1182 | type
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;
# Line 1152 | Line 1198 | type
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;
# Line 1167 | Line 1215 | type
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);
# Line 1335 | Line 1390 | type
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;
# Line 1356 | Line 1413 | type
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;
# Line 1419 | Line 1475 | procedure CheckIBLoaded;
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  
# Line 1527 | Line 1587 | begin
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;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines