|
@@ -25,6 +25,7 @@ uses SysUtils, Classes, DB, bufdataset, sqlscript;
|
|
type TSchemaType = (stNoSchema, stTables, stSysTables, stProcedures, stColumns, stProcedureParams, stIndexes, stPackages);
|
|
type TSchemaType = (stNoSchema, stTables, stSysTables, stProcedures, stColumns, stProcedureParams, stIndexes, stPackages);
|
|
TConnOption = (sqSupportParams,sqEscapeSlash,sqEscapeRepeat);
|
|
TConnOption = (sqSupportParams,sqEscapeSlash,sqEscapeRepeat);
|
|
TConnOptions= set of TConnOption;
|
|
TConnOptions= set of TConnOption;
|
|
|
|
+ TConnInfoType=(citAll=-1, citServerType, citServerVersion, citServerVersionString, citClientName, citClientVersion);
|
|
|
|
|
|
TRowsCount = LargeInt;
|
|
TRowsCount = LargeInt;
|
|
|
|
|
|
@@ -96,9 +97,8 @@ type
|
|
FCharSet : string;
|
|
FCharSet : string;
|
|
FRole : String;
|
|
FRole : String;
|
|
|
|
|
|
-
|
|
|
|
function GetPort: cardinal;
|
|
function GetPort: cardinal;
|
|
- procedure Setport(const AValue: cardinal);
|
|
|
|
|
|
+ procedure SetPort(const AValue: cardinal);
|
|
protected
|
|
protected
|
|
FConnOptions : TConnOptions;
|
|
FConnOptions : TConnOptions;
|
|
FSQLFormatSettings : TFormatSettings;
|
|
FSQLFormatSettings : TFormatSettings;
|
|
@@ -134,7 +134,7 @@ type
|
|
function GetSchemaInfoSQL(SchemaType : TSchemaType; SchemaObjectName, SchemaPattern : string) : string; virtual;
|
|
function GetSchemaInfoSQL(SchemaType : TSchemaType; SchemaObjectName, SchemaPattern : string) : string; virtual;
|
|
procedure LoadBlobIntoBuffer(FieldDef: TFieldDef;ABlobBuf: PBufBlobField; cursor: TSQLCursor; ATransaction : TSQLTransaction); virtual; abstract;
|
|
procedure LoadBlobIntoBuffer(FieldDef: TFieldDef;ABlobBuf: PBufBlobField; cursor: TSQLCursor; ATransaction : TSQLTransaction); virtual; abstract;
|
|
function RowsAffected(cursor: TSQLCursor): TRowsCount; virtual;
|
|
function RowsAffected(cursor: TSQLCursor): TRowsCount; virtual;
|
|
- property port: cardinal read GetPort write Setport;
|
|
|
|
|
|
+ property Port: cardinal read GetPort write SetPort;
|
|
public
|
|
public
|
|
property Handle: Pointer read GetHandle;
|
|
property Handle: Pointer read GetHandle;
|
|
property FieldNameQuoteChars: TQuoteChars read FFieldNameQuoteChars write FFieldNameQuoteChars;
|
|
property FieldNameQuoteChars: TQuoteChars read FFieldNameQuoteChars write FFieldNameQuoteChars;
|
|
@@ -147,7 +147,8 @@ type
|
|
procedure ExecuteDirect(SQL : String; ATransaction : TSQLTransaction); overload; virtual;
|
|
procedure ExecuteDirect(SQL : String; ATransaction : TSQLTransaction); overload; virtual;
|
|
procedure GetTableNames(List : TStrings; SystemTables : Boolean = false); virtual;
|
|
procedure GetTableNames(List : TStrings; SystemTables : Boolean = false); virtual;
|
|
procedure GetProcedureNames(List : TStrings); virtual;
|
|
procedure GetProcedureNames(List : TStrings); virtual;
|
|
- procedure GetFieldNames(const TableName : string; List : TStrings); virtual;
|
|
|
|
|
|
+ procedure GetFieldNames(const TableName : string; List : TStrings); virtual;
|
|
|
|
+ function GetConnectionInfo(InfoType:TConnInfoType): string; virtual;
|
|
procedure CreateDB; virtual;
|
|
procedure CreateDB; virtual;
|
|
procedure DropDB; virtual;
|
|
procedure DropDB; virtual;
|
|
published
|
|
published
|
|
@@ -483,6 +484,7 @@ type
|
|
Class Function DefaultLibraryName : String; virtual;
|
|
Class Function DefaultLibraryName : String; virtual;
|
|
Class Function LoadFunction : TLibraryLoadFunction; virtual;
|
|
Class Function LoadFunction : TLibraryLoadFunction; virtual;
|
|
Class Function UnLoadFunction : TLibraryUnLoadFunction; virtual;
|
|
Class Function UnLoadFunction : TLibraryUnLoadFunction; virtual;
|
|
|
|
+ Class Function LoadedLibraryName : string; virtual;
|
|
Procedure ApplyParams(Params : TStrings; AConnection : TSQLConnection); virtual;
|
|
Procedure ApplyParams(Params : TStrings; AConnection : TSQLConnection); virtual;
|
|
end;
|
|
end;
|
|
TConnectionDefClass = class of TConnectionDef;
|
|
TConnectionDefClass = class of TConnectionDef;
|
|
@@ -638,7 +640,7 @@ begin
|
|
result := StrToIntDef(Params.Values['Port'],0);
|
|
result := StrToIntDef(Params.Values['Port'],0);
|
|
end;
|
|
end;
|
|
|
|
|
|
-procedure TSQLConnection.Setport(const AValue: cardinal);
|
|
|
|
|
|
+procedure TSQLConnection.SetPort(const AValue: cardinal);
|
|
begin
|
|
begin
|
|
if AValue<>0 then
|
|
if AValue<>0 then
|
|
params.Values['Port']:=IntToStr(AValue)
|
|
params.Values['Port']:=IntToStr(AValue)
|
|
@@ -701,6 +703,18 @@ begin
|
|
GetDBInfo(stColumns,TableName,'column_name',List);
|
|
GetDBInfo(stColumns,TableName,'column_name',List);
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+function TSQLConnection.GetConnectionInfo(InfoType: TConnInfoType): string;
|
|
|
|
+var i: TConnInfoType;
|
|
|
|
+begin
|
|
|
|
+ Result:='';
|
|
|
|
+ if InfoType = citAll then
|
|
|
|
+ for i:=citServerType to citClientVersion do
|
|
|
|
+ begin
|
|
|
|
+ if Result<>'' then Result:=Result+',';
|
|
|
|
+ Result:=Result+'"'+GetConnectionInfo(i)+'"';
|
|
|
|
+ end;
|
|
|
|
+end;
|
|
|
|
+
|
|
function TSQLConnection.GetAsSQLText(Field : TField) : string;
|
|
function TSQLConnection.GetAsSQLText(Field : TField) : string;
|
|
|
|
|
|
begin
|
|
begin
|
|
@@ -2258,6 +2272,11 @@ begin
|
|
Result:=Nil;
|
|
Result:=Nil;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+class function TConnectionDef.LoadedLibraryName: string;
|
|
|
|
+begin
|
|
|
|
+ Result:='';
|
|
|
|
+end;
|
|
|
|
+
|
|
procedure TConnectionDef.ApplyParams(Params: TStrings;
|
|
procedure TConnectionDef.ApplyParams(Params: TStrings;
|
|
AConnection: TSQLConnection);
|
|
AConnection: TSQLConnection);
|
|
begin
|
|
begin
|