mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2026-03-13 09:24:25 +08:00
Add support for BOOLEAN column data type in PostgreSQL. See http://www.heidisql.com/forum.php?t=16072#p16204
This commit is contained in:
@@ -5338,6 +5338,8 @@ begin
|
||||
SetString(AnsiStr, PQgetvalue(FCurrentResults, FRecNoLocal, Column), FColumnLengths[Column]);
|
||||
if Datatype(Column).Category in [dtcBinary, dtcSpatial] then
|
||||
Result := String(AnsiStr)
|
||||
else if Datatype(Column).Index = dtbool then
|
||||
if AnsiStr='t' then Result := 'true' else Result := 'false'
|
||||
else
|
||||
Result := Connection.DecodeAPIString(AnsiStr);
|
||||
end;
|
||||
@@ -5431,8 +5433,12 @@ begin
|
||||
Result.QuoteChar := '''';
|
||||
Result.Delimiter := ',';
|
||||
ColAttr := ColAttributes(Column);
|
||||
if Assigned(ColAttr) and (ColAttr.DataType.Index in [dtEnum, dtSet]) then
|
||||
Result.DelimitedText := ColAttr.LengthSet;
|
||||
if Assigned(ColAttr) then case ColAttr.DataType.Index of
|
||||
dtEnum, dtSet:
|
||||
Result.DelimitedText := ColAttr.LengthSet;
|
||||
dtBool:
|
||||
Result.DelimitedText := 'true,false';
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
@@ -8548,7 +8548,7 @@ begin
|
||||
TypeCat := Results.DataType(Column).Category;
|
||||
if Assigned(EditLink) then
|
||||
// Editor was created above, do nothing now
|
||||
else if (Results.DataType(Column).Index = dtEnum) and AppSettings.ReadBool(asFieldEditorEnum) then begin
|
||||
else if (Results.DataType(Column).Index in [dtEnum, dtBool]) and AppSettings.ReadBool(asFieldEditorEnum) then begin
|
||||
EnumEditor := TEnumEditorLink.Create(VT);
|
||||
EnumEditor.ValueList := Results.ValueList(Column);
|
||||
EditLink := EnumEditor;
|
||||
|
||||
@@ -186,9 +186,10 @@ type
|
||||
dtDate, dtTime, dtYear, dtDatetime, dtSmalldatetime, dtTimestamp,
|
||||
dtChar, dtNchar, dtVarchar, dtNvarchar, dtTinytext, dtText, dtNtext, dtMediumtext, dtLongtext,
|
||||
dtBinary, dtVarbinary, dtTinyblob, dtBlob, dtMediumblob, dtLongblob, dtImage,
|
||||
dtEnum, dtSet, dtBit, dtVarBit,
|
||||
dtEnum, dtSet, dtBit, dtVarBit, dtBool,
|
||||
dtCursor, dtSqlvariant, dtTable, dtUniqueidentifier,
|
||||
dtPoint, dtLinestring, dtLineSegment, dtPolygon, dtGeometry, dtBox, dtPath, dtCircle, dtMultipoint, dtMultilinestring, dtMultipolygon, dtGeometrycollection);
|
||||
dtPoint, dtLinestring, dtLineSegment, dtPolygon, dtGeometry, dtBox, dtPath, dtCircle, dtMultipoint, dtMultilinestring, dtMultipolygon, dtGeometrycollection
|
||||
);
|
||||
|
||||
// MySQL data type categorization
|
||||
TDBDatatypeCategoryIndex = (dtcInteger, dtcReal, dtcText, dtcBinary, dtcTemporal, dtcSpatial, dtcOther);
|
||||
@@ -1120,7 +1121,7 @@ var
|
||||
)
|
||||
);
|
||||
|
||||
PostgreSQLDatatypes: Array[0..25] of TDBDatatype =
|
||||
PostgreSQLDatatypes: Array[0..26] of TDBDatatype =
|
||||
(
|
||||
(
|
||||
Index: dtSmallint;
|
||||
@@ -1418,6 +1419,18 @@ var
|
||||
HasBinary: False;
|
||||
HasDefault: False;
|
||||
Category: dtcSpatial;
|
||||
),
|
||||
(
|
||||
Index: dtBool;
|
||||
NativeTypes: '16';
|
||||
Name: 'BOOLEAN';
|
||||
Names: 'boolean|bool';
|
||||
Description: 'State of true or false. Storage size: 1 byte.';
|
||||
HasLength: False;
|
||||
RequiresLength: False;
|
||||
HasBinary: False;
|
||||
HasDefault: False;
|
||||
Category: dtcOther;
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user