mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-26 11:17:57 +08:00
Issue #1169: implement
* TInterbaseConnection.GetCollationTable * TInterbaseConnection.GetCharsetTable * TInterbaseConnection.FetchDbObjects
This commit is contained in:
@ -456,6 +456,7 @@ type
|
|||||||
FCurrentUserHostCombination: String;
|
FCurrentUserHostCombination: String;
|
||||||
FAllUserHostCombinations: TStringList;
|
FAllUserHostCombinations: TStringList;
|
||||||
FLockedByThread: TThread;
|
FLockedByThread: TThread;
|
||||||
|
FStringQuoteChar: Char;
|
||||||
FQuoteChar: Char;
|
FQuoteChar: Char;
|
||||||
FQuoteChars: String;
|
FQuoteChars: String;
|
||||||
FDatatypes: TDBDataTypeArray;
|
FDatatypes: TDBDataTypeArray;
|
||||||
@ -764,6 +765,7 @@ type
|
|||||||
function GetLastErrorCode: Cardinal; override;
|
function GetLastErrorCode: Cardinal; override;
|
||||||
function GetLastErrorMsg: String; override;
|
function GetLastErrorMsg: String; override;
|
||||||
function GetAllDatabases: TStringList; override;
|
function GetAllDatabases: TStringList; override;
|
||||||
|
function GetCollationTable: TDBQuery; override;
|
||||||
function GetCharsetTable: TDBQuery; override;
|
function GetCharsetTable: TDBQuery; override;
|
||||||
procedure FetchDbObjects(db: String; var Cache: TDBObjectList); override;
|
procedure FetchDbObjects(db: String; var Cache: TDBObjectList); override;
|
||||||
public
|
public
|
||||||
@ -1969,6 +1971,7 @@ begin
|
|||||||
FIdentCharsNoQuote := ['A'..'Z', 'a'..'z', '0'..'9', '_'];
|
FIdentCharsNoQuote := ['A'..'Z', 'a'..'z', '0'..'9', '_'];
|
||||||
FMaxRowsPerInsert := 10000;
|
FMaxRowsPerInsert := 10000;
|
||||||
FCaseSensitivity := 0;
|
FCaseSensitivity := 0;
|
||||||
|
FStringQuoteChar := '''';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -2040,6 +2043,7 @@ var
|
|||||||
i: Integer;
|
i: Integer;
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
|
FStringQuoteChar := '"';
|
||||||
FQuoteChar := '"';
|
FQuoteChar := '"';
|
||||||
FQuoteChars := '"[]';
|
FQuoteChars := '"[]';
|
||||||
SetLength(FDatatypes, Length(SQLiteDatatypes));
|
SetLength(FDatatypes, Length(SQLiteDatatypes));
|
||||||
@ -3002,7 +3006,7 @@ begin
|
|||||||
FSQLSpecifities[spSessionVariables] := 'SHOW VARIABLES';
|
FSQLSpecifities[spSessionVariables] := 'SHOW VARIABLES';
|
||||||
FSQLSpecifities[spGlobalVariables] := 'SHOW GLOBAL VARIABLES';
|
FSQLSpecifities[spGlobalVariables] := 'SHOW GLOBAL VARIABLES';
|
||||||
FSQLSpecifities[spISSchemaCol] := '%s_SCHEMA';
|
FSQLSpecifities[spISSchemaCol] := '%s_SCHEMA';
|
||||||
FSQLSpecifities[spUSEQuery] := 'USE %s';
|
FSQLSpecifities[spUSEQuery] := '-- USE %s';
|
||||||
FSQLSpecifities[spKillQuery] := 'KILL %d';
|
FSQLSpecifities[spKillQuery] := 'KILL %d';
|
||||||
FSQLSpecifities[spKillProcess] := 'KILL %d';
|
FSQLSpecifities[spKillProcess] := 'KILL %d';
|
||||||
FSQLSpecifities[spFuncLength] := 'LENGTH';
|
FSQLSpecifities[spFuncLength] := 'LENGTH';
|
||||||
@ -4803,11 +4807,20 @@ begin
|
|||||||
Result := escChars(Result, '''', '''', '''', '''', '''');
|
Result := escChars(Result, '''', '''', '''', '''', '''');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
ngInterbase: begin
|
||||||
|
c1 := '''';
|
||||||
|
c2 := '''';
|
||||||
|
c3 := '''';
|
||||||
|
c4 := '''';
|
||||||
|
EscChar := '\';
|
||||||
|
Result := escChars(Text, EscChar, c1, c2, c3, c4);
|
||||||
|
end;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if DoQuote then begin
|
if DoQuote then begin
|
||||||
// Add surrounding single quotes
|
// Add surrounding single quotes
|
||||||
Result := Char(#39) + Result + Char(#39);
|
Result := FStringQuoteChar + Result + FStringQuoteChar;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -5155,6 +5168,18 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function TInterbaseConnection.GetCollationTable: TDBQuery;
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
if not Assigned(FCollationTable) then begin
|
||||||
|
FCollationTable := GetResults('SELECT RDB$COLLATION_NAME AS '+EscapeString('Collation')+', RDB$COLLATION_ID AS '+EscapeString('Id')+', RDB$CHARACTER_SET_ID FROM RDB$COLLATIONS');
|
||||||
|
end;
|
||||||
|
if Assigned(FCollationTable) then
|
||||||
|
FCollationTable.First;
|
||||||
|
Result := FCollationTable;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
function TDBConnection.GetCollationList: TStringList;
|
function TDBConnection.GetCollationList: TStringList;
|
||||||
var
|
var
|
||||||
c: TDBQuery;
|
c: TDBQuery;
|
||||||
@ -5220,7 +5245,10 @@ end;
|
|||||||
|
|
||||||
function TInterbaseConnection.GetCharsetTable: TDBQuery;
|
function TInterbaseConnection.GetCharsetTable: TDBQuery;
|
||||||
begin
|
begin
|
||||||
// Todo
|
inherited;
|
||||||
|
if not Assigned(FCharsetTable) then
|
||||||
|
FCharsetTable := GetResults('SELECT RDB$CHARACTER_SET_NAME AS '+EscapeString('Charset')+', RDB$CHARACTER_SET_NAME AS '+EscapeString('Description')+' FROM RDB$CHARACTER_SETS');
|
||||||
|
Result := FCharsetTable;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -6935,8 +6963,33 @@ end;
|
|||||||
|
|
||||||
|
|
||||||
procedure TInterbaseConnection.FetchDbObjects(db: String; var Cache: TDBObjectList);
|
procedure TInterbaseConnection.FetchDbObjects(db: String; var Cache: TDBObjectList);
|
||||||
|
var
|
||||||
|
obj: TDBObject;
|
||||||
|
Results: TDBQuery;
|
||||||
begin
|
begin
|
||||||
// Todo
|
// Tables and views
|
||||||
|
Results := nil;
|
||||||
|
try
|
||||||
|
Results := GetResults('SELECT DISTINCT RDB$RELATION_NAME, RDB$VIEW_CONTEXT AS '+EscapeString('ViewContext') +
|
||||||
|
' FROM RDB$RELATION_FIELDS WHERE RDB$SYSTEM_FLAG=0');
|
||||||
|
while not Results.Eof do begin
|
||||||
|
obj := TDBObject.Create(Self);
|
||||||
|
Cache.Add(obj);
|
||||||
|
obj.Name := Results.Col(0);
|
||||||
|
obj.Created := Now;
|
||||||
|
obj.Updated := Now;
|
||||||
|
obj.Database := db;
|
||||||
|
if Results.IsNull(1) then
|
||||||
|
obj.NodeType := lntTable
|
||||||
|
else
|
||||||
|
obj.NodeType := lntView;
|
||||||
|
obj.NodeType := lntTable;
|
||||||
|
Results.Next;
|
||||||
|
end;
|
||||||
|
FreeAndNil(Results);
|
||||||
|
except
|
||||||
|
on E:EDbError do;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user