mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2026-03-13 09:24:25 +08:00
Render primary key columns in query results in bold font, like in data grid.
This commit is contained in:
@@ -3988,6 +3988,7 @@ begin
|
||||
ActiveGridResult.Columns[i].DatatypeCat := Results.DataType(i).Category;
|
||||
if ActiveGridResult.Columns[i].DatatypeCat in [dtcInteger, dtcReal] then
|
||||
col.Alignment := taRightJustify;
|
||||
ActiveGridResult.Columns[i].IsPriPart := Results.ColIsPrimaryKeyPart(i);
|
||||
end;
|
||||
debug('mem: query column initialization complete.');
|
||||
debug('mem: clearing and initializing query rows (internal data).');
|
||||
|
||||
@@ -184,6 +184,7 @@ type
|
||||
function Col(ColumnName: WideString; IgnoreErrors: Boolean=False): WideString; overload;
|
||||
function DataType(Column: Integer): TDataType;
|
||||
function ColExists(Column: WideString): Boolean;
|
||||
function ColIsPrimaryKeyPart(Column: Integer): Boolean;
|
||||
function IsNull(Column: Integer): Boolean;
|
||||
function HasResult: Boolean;
|
||||
property RecNo: Int64 read FRecNo write SetRecNo;
|
||||
@@ -932,6 +933,18 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
function TMySQLQuery.ColIsPrimaryKeyPart(Column: Integer): Boolean;
|
||||
var
|
||||
Field: PMYSQL_FIELD;
|
||||
begin
|
||||
if HasResult and (Column < ColumnCount) then begin
|
||||
Field := mysql_fetch_field_direct(FLastResult, Column);
|
||||
Result := (Field.flags and PRI_KEY_FLAG) = PRI_KEY_FLAG;
|
||||
end else
|
||||
Result := False;
|
||||
end;
|
||||
|
||||
|
||||
function TMySQLQuery.IsNull(Column: Integer): Boolean;
|
||||
begin
|
||||
Result := FCurrentRow[Column] = nil;
|
||||
|
||||
Reference in New Issue
Block a user