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

Comparing:
ibx/trunk/fbintf/IB.pas (file contents), Revision 338 by tony, Wed Jun 9 12:07:56 2021 UTC vs.
ibx/branches/journaling/fbintf/IB.pas (file contents), Revision 362 by tony, Tue Dec 7 13:27:39 2021 UTC

# Line 134 | Line 134 | uses
134   const
135    {Interface version information}
136    FBIntf_Major = 1;
137 <  FBIntf_Minor = 2;
138 <  FBIntf_Release = 1;
139 <  FBIntf_Version = '1.2.1';
137 >  FBIntf_Minor = 3;
138 >  FBIntf_Release = 3;
139 >  FBIntf_Version = '1.3.3';
140  
141   const
142    {DPB, TPB and SPB Parameter Block Name Prefixes}
# Line 263 | Line 263 | type
263  
264    IParameterBlockWithTypeNames<_IItem> = interface(IParameterBlock<_IItem>)
265      function AddByTypeName(ParamTypeName: AnsiString): _IItem;
266 <    function GetDPBParamTypeName(ParamType: byte): Ansistring;
266 >    function GetDPBParamTypeName(ParamType: byte): Ansistring; deprecated 'Use Get ParamTypeName';
267 >    function GetParamTypeName(ParamType: byte): Ansistring;
268    end;
269  
270    {IParameterBlockItem is not used on its own but instead provides a base type for
# Line 300 | Line 301 | type
301  
302     TIBDataBaseErrorMessages   = set of TIBDataBaseErrorMessage;
303  
304 +   TStatusCode = long;
305 +
306    IStatus = interface
307      ['{34167722-af38-4831-b08a-93162d58ede3}']
308 <    function GetIBErrorCode: Long;
309 <    function Getsqlcode: Long;
308 >    function GetIBErrorCode: TStatusCode;
309 >    function Getsqlcode: TStatusCode;
310      function GetMessage: AnsiString;
311      function CheckStatusVector(ErrorCodes: array of TFBStatusCode): Boolean;
312      function GetIBDataBaseErrorMessages: TIBDataBaseErrorMessages;
# Line 611 | Line 614 | type
614    }
615    IResultSet = interface(IResults)
616      ['{0ae4979b-7857-4e8c-8918-ec6f155b51a0}']
617 <    function FetchNext: boolean;
617 >    function FetchNext: boolean; {fetch next record}
618 >    function FetchPrior: boolean; {fetch previous record}
619 >    function FetchFirst:boolean; {fetch first record}
620 >    function FetchLast: boolean; {fetch last record}
621 >    function FetchAbsolute(position: Integer): boolean; {fetch record by its absolute position in result set}
622 >    function FetchRelative(offset: Integer): boolean; {fetch record by position relative to current}
623      function GetCursorName: AnsiString;
624 +    function IsBof: boolean;
625      function IsEof: boolean;
626      procedure Close;
627    end;
628  
629    {The ISQLParam interface is used to provide access to each parameter in a
630 <   parametised SQL Statement. It subclasses IColumnMetaData and this part of
622 <   the interface may be used to access information on the expected SQL Type, etc.
623 <
624 <   It also subclasses ISQLData and this part of the interface may be used to access
625 <   current values for each parameter.
626 <
627 <   Otherwise, the interface comprises the Setter Methods and properties used to
630 >   parametised SQL Statement. The interface comprises the Setter Methods and properties used to
631     set the value of each parameter.
632  
633     Automatic conversion is provided to and from strings. That is GetAsString and
634     SetAsString are safe to use for sql types other than boolean - provided automatic
635     conversion is possible.
636 +
637 +   ISQLParam is subclassed from the IParamMetaData interface. This interface provides
638 +   access to the parameter metadata. This metadata is mutable and can change after
639 +   a parameter is set to a given value. This is acceptable as long as the parameter
640 +   metadata is type compatible with the underlying column metadata and hence the
641 +   parameter value can be converted by Firebird into a value acceptable by the
642 +   underlying column. The column metadata, which is unmutable, can be obtained
643 +   by the ISQLParam.getColMetadata interface. When a statement is prepared, the
644 +   parameter metadata is always initialised to the column metadata.
645    }
646  
647 <  ISQLParam = interface
648 <    ['{b22b4578-6d41-4807-a9a9-d2ec8d1d5a14}']
637 <    function GetIndex: integer;
647 >  IParamMetaData = interface
648 >  ['{4e148c4e-2d48-4991-a263-f66eca05c6aa}']
649      function GetSQLType: cardinal;
650      function GetSQLTypeName: AnsiString;
651      function getSubtype: integer;
641    function getName: AnsiString;
652      function getScale: integer;
653      function getCharSetID: cardinal;
654      function getCodePage: TSystemCodePage;
655      function getIsNullable: boolean;
656      function GetSize: cardinal;
657 +    property SQLType: cardinal read GetSQLType;
658 +  end;
659 +
660 +  ISQLParam = interface(IParamMetaData)
661 +    ['{b22b4578-6d41-4807-a9a9-d2ec8d1d5a14}']
662 +    function getColMetadata: IParamMetaData;
663 +    function GetIndex: integer;
664 +    function getName: AnsiString;
665      function GetAsBoolean: boolean;
666      function GetAsCurrency: Currency;
667      function GetAsInt64: Int64;
# Line 720 | Line 738 | type
738      property IsNullable: Boolean read GetIsNullable;
739      property Modified: Boolean read getModified;
740      property Name: AnsiString read GetName;
723    property SQLType: cardinal read GetSQLType;
741    end;
742  
743     {
# Line 747 | Line 764 | type
764  
765    TPerfCounters = array[TPerfStats] of Int64;
766  
767 +  {Batch Query Execution Support}
768 +
769 +  TBatchCompletionState = (bcExecuteFailed, bcSuccessNoInfo, bcNoMoreErrors);
770 +
771 +  IBatchCompletion = interface
772 +  ['{9bc3d49d-16d9-4606-94e5-ee987103ad92}']
773 +    function getTotalProcessed: cardinal;
774 +    function getState(updateNo: cardinal): TBatchCompletionState;
775 +    function getStatusMessage(updateNo: cardinal): AnsiString;
776 +    function getUpdated: integer;
777 +    function getErrorStatus(var RowNo: integer; var status: IStatus): boolean;
778 +    end;
779 +
780    {The IStatement interface provides access to an SQL Statement once it has been
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 758 | Line 791 | type
791      function GetPlan: AnsiString;
792      function GetRowsAffected(var SelectCount, InsertCount, UpdateCount, DeleteCount: integer): boolean;
793      function GetSQLStatementType: TIBSQLStatementTypes;
794 +    function GetSQLStatementTypeName: AnsiString;
795      function GetSQLText: AnsiString;
796      function GetProcessedSQLText: AnsiString;
797      function GetSQLDialect: integer;
798 +    function GetFlags: TStatementFlags;
799      function IsPrepared: boolean;
800 <    procedure Prepare(aTransaction: ITransaction=nil);
800 >    function HasBatchMode: boolean;
801 >    function IsInBatchMode: boolean;
802 >    procedure Prepare(aTransaction: ITransaction=nil); overload;
803 >    procedure Prepare(CursorName: AnsiString; aTransaction: ITransaction=nil); overload;
804      function Execute(aTransaction: ITransaction=nil): IResults;
805 <    function OpenCursor(aTransaction: ITransaction=nil): IResultSet;
805 >    function OpenCursor(aTransaction: ITransaction=nil): IResultSet; overload;
806 >    function OpenCursor(Scrollable: boolean; aTransaction: ITransaction=nil): IResultSet; overload;
807      function GetAttachment: IAttachment;
808      function GetTransaction: ITransaction;
809      procedure SetRetainInterfaces(aValue: boolean);
810      procedure EnableStatistics(aValue: boolean);
811      function GetPerfStatistics(var stats: TPerfCounters): boolean;
812 +    {IBatch interface support}
813 +    procedure AddToBatch;
814 +    function ExecuteBatch(aTransaction: ITransaction=nil): IBatchCompletion;
815 +    procedure CancelBatch;
816 +    function GetBatchCompletion: IBatchCompletion;
817 +    function GetBatchRowLimit: integer;
818 +    procedure SetBatchRowLimit(aLimit: integer);
819 +    {Stale Reference Check}
820 +    procedure SetStaleReferenceChecks(Enable:boolean); {default true}
821 +    function GetStaleReferenceChecks: boolean;
822 +
823      property MetaData: IMetaData read GetMetaData;
824      property SQLParams: ISQLParams read GetSQLParams;
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 811 | 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      procedure PrepareForCommit; {Two phase commit - stage 1}
888      procedure Commit(Force: boolean=false);
889      procedure CommitRetaining;
# Line 819 | Line 892 | type
892      procedure RollbackRetaining;
893      function GetAttachmentCount: integer;
894      function GetAttachment(index: integer): IAttachment;
895 +    function GetTrInformation(Requests: array of byte): ITrInformation; overload;
896 +    function GetTrInformation(Request: byte): ITrInformation; overload;
897      property InTransaction: boolean read GetInTransaction;
898    end;
899  
# Line 919 | Line 994 | type
994      function getSize: integer;
995      procedure getRawBytes(var Buffer);
996      function getAsString: AnsiString;
997 <    function getAsInteger: integer;
997 >    function getAsInteger: int64;
998      procedure DecodeIDCluster(var ConnectionType: integer; var DBFileName, DBSiteName: AnsiString);
999      function getAsBytes: TByteArray;
1000      function getAsDateTime: TDateTime;
# Line 931 | Line 1006 | type
1006      function GetCount: integer;
1007      function GetItem(index: integer): IDBInfoItem;
1008      function Find(ItemType: byte): IDBInfoItem;
1009 <    property AsInteger: integer read getAsInteger;
1009 >    property AsInteger: int64 read getAsInteger;
1010      property AsString: AnsiString read GetAsString;
1011      property Count: integer read GetCount;
1012      property Items[index: integer]: IDBInfoItem read getItem; default;
# Line 1029 | Line 1104 | type
1104      function ExecuteSQL(transaction: ITransaction; sql: AnsiString; SQLDialect: integer; params: array of const): IResults; overload;
1105      function ExecuteSQL(TPB: array of byte; sql: AnsiString; params: array of const): IResults; overload;
1106      function ExecuteSQL(transaction: ITransaction; sql: AnsiString; params: array of const): IResults; overload;
1032    function OpenCursor(transaction: ITransaction; sql: AnsiString; aSQLDialect: integer): IResultSet; overload;
1107      function OpenCursor(transaction: ITransaction; sql: AnsiString; aSQLDialect: integer;
1108 +                             Scrollable: boolean=false): IResultSet; overload;
1109 +    function OpenCursor(transaction: ITransaction; sql: AnsiString; aSQLDialect: integer;
1110 +                             params: array of const): IResultSet; overload;
1111 +    function OpenCursor(transaction: ITransaction; sql: AnsiString; Scrollable: boolean=false): IResultSet; overload;
1112 +    function OpenCursor(transaction: ITransaction; sql: AnsiString; Scrollable: boolean;
1113                               params: array of const): IResultSet; overload;
1035    function OpenCursor(transaction: ITransaction; sql: AnsiString): IResultSet; overload;
1114      function OpenCursor(transaction: ITransaction; sql: AnsiString;
1115                               params: array of const): IResultSet; overload;
1116 <    function OpenCursorAtStart(transaction: ITransaction; sql: AnsiString; aSQLDialect: integer): IResultSet; overload;
1116 >    function OpenCursor(transaction: ITransaction; sql: AnsiString; aSQLDialect: integer; Scrollable: boolean;
1117 >                             params: array of const): IResultSet; overload;
1118 >    function OpenCursorAtStart(transaction: ITransaction; sql: AnsiString; aSQLDialect: integer;
1119 >                             Scrollable: boolean=false): IResultSet; overload;
1120      function OpenCursorAtStart(transaction: ITransaction; sql: AnsiString; aSQLDialect: integer;
1121                               params: array of const): IResultSet; overload;
1122 <    function OpenCursorAtStart(transaction: ITransaction; sql: AnsiString): IResultSet; overload;
1122 >    function OpenCursorAtStart(transaction: ITransaction; sql: AnsiString; aSQLDialect: integer; Scrollable: boolean;
1123 >                             params: array of const): IResultSet; overload;
1124 >    function OpenCursorAtStart(transaction: ITransaction; sql: AnsiString; Scrollable: boolean=false): IResultSet; overload;
1125      function OpenCursorAtStart(transaction: ITransaction; sql: AnsiString;
1126                               params: array of const): IResultSet; overload;
1127 <    function OpenCursorAtStart(sql: AnsiString): IResultSet; overload;
1127 >    function OpenCursorAtStart(transaction: ITransaction; sql: AnsiString; Scrollable: boolean;
1128 >                             params: array of const): IResultSet; overload;
1129 >    function OpenCursorAtStart(sql: AnsiString; Scrollable: boolean=false): IResultSet; overload;
1130 >    function OpenCursorAtStart(sql: AnsiString; Scrollable: boolean;
1131 >                             params: array of const): IResultSet; overload;
1132      function OpenCursorAtStart(sql: AnsiString;
1133                               params: array of const): IResultSet; overload;
1134 <    function Prepare(transaction: ITransaction; sql: AnsiString; aSQLDialect: integer): IStatement; overload;
1135 <    function Prepare(transaction: ITransaction; sql: AnsiString): IStatement; overload;
1134 >    function Prepare(transaction: ITransaction; sql: AnsiString; aSQLDialect: integer; CursorName: AnsiString=''): IStatement; overload;
1135 >    function Prepare(transaction: ITransaction; sql: AnsiString; CursorName: AnsiString=''): IStatement; overload;
1136      function PrepareWithNamedParameters(transaction: ITransaction; sql: AnsiString;
1137                         aSQLDialect: integer; GenerateParamNames: boolean=false;
1138 <                       CaseSensitiveParams: boolean = false): IStatement; overload;
1138 >                       CaseSensitiveParams: boolean = false; CursorName: AnsiString=''): IStatement; overload;
1139      function PrepareWithNamedParameters(transaction: ITransaction; sql: AnsiString;
1140                         GenerateParamNames: boolean=false;
1141 <                       CaseSensitiveParams: boolean = false): IStatement; overload;
1141 >                       CaseSensitiveParams: boolean = false; CursorName: AnsiString=''): IStatement; overload;
1142  
1143      {Events}
1144      function GetEventHandler(Events: TStrings): IEvents; overload;
# Line 1064 | Line 1151 | type
1151      function CreateBlob(transaction: ITransaction; SubType: integer; CharSetID: cardinal=0; BPB: IBPB=nil): IBlob; overload;
1152      function OpenBlob(transaction: ITransaction; RelationName, ColumnName: AnsiString; BlobID: TISC_QUAD; BPB: IBPB=nil): IBlob; overload;
1153      function OpenBlob(transaction: ITransaction; BlobMetaData: IBlobMetaData; BlobID: TISC_QUAD; BPB: IBPB=nil): IBlob;  overload;
1154 +    function GetInlineBlobLimit: integer;
1155 +    procedure SetInlineBlobLimit(limit: integer);
1156  
1157      {Array - may use to open existing arrays. However, ISQLData.AsArray is preferred}
1158  
# Line 1091 | Line 1180 | type
1180      procedure getFBVersion(version: TStrings);
1181      function HasActivity: boolean;
1182      function HasDecFloatSupport: boolean;
1183 +    function HasBatchMode: boolean;
1184 +    function HasScollableCursors: boolean;
1185  
1186      {Character Sets}
1187      function HasDefaultCharSet: boolean;
# Line 1187 | Line 1278 | type
1278      function getSize: integer;
1279      procedure getRawBytes(var Buffer);
1280      function getAsString: AnsiString;
1281 <    function getAsInteger: integer;
1281 >    function getAsInteger: int64;
1282      function getAsByte: byte;
1283      function CopyTo(stream: TStream; count: integer): integer;
1284      property AsString: AnsiString read getAsString;
1285 <    property AsInteger: integer read getAsInteger;
1285 >    property AsInteger: int64 read getAsInteger;
1286      property AsByte: byte read getAsByte;
1287    end;
1288  
# Line 1334 | Line 1425 | type
1425     {IB Client Exceptions}
1426     EIBClientError = class(EIBError);
1427  
1428 +   {Used to explicitly report a Batch Buffer overflow}
1429 +   EIBBatchBufferOverflow = class(EIBError);
1430 +
1431   {The Firebird API function is used to access the IFirebirdAPI interface.
1432  
1433   It will load the Firebird Client Library if this is not already loaded and

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines