* Add support for citext field

git-svn-id: trunk@42832 -
This commit is contained in:
michael 2019-08-26 18:50:03 +00:00
parent 25681cc2a3
commit 3d64594ad7

View File

@ -33,7 +33,7 @@ type
// TField and TFieldDef only support a limited amount of fields. // TField and TFieldDef only support a limited amount of fields.
// TFieldBinding and TExtendedFieldType can be used to map PQ types // TFieldBinding and TExtendedFieldType can be used to map PQ types
// on standard fields and retain mapping info. // on standard fields and retain mapping info.
TExtendedFieldType = (eftNone,eftEnum); TExtendedFieldType = (eftNone,eftEnum,eftCitext);
TFieldBinding = record TFieldBinding = record
FieldDef : TSQLDBFieldDef; // FieldDef this is associated with FieldDef : TSQLDBFieldDef; // FieldDef this is associated with
@ -366,15 +366,16 @@ begin
tt:=pqgetvalue(Res,i,2); tt:=pqgetvalue(Res,i,2);
tc:=pqgetvalue(Res,i,3); tc:=pqgetvalue(Res,i,3);
J:=length(Bindings)-1; J:=length(Bindings)-1;
while (J>=0) and (Bindings[j].TypeOID<>toid) do while (J>= 0) do
Dec(J);
if (J>=0) then
begin begin
Bindings[j].TypeName:=TN; if (Bindings[j].TypeOID=toid) then
Case tt of Case tt of
'e': // Enum 'e':
Bindings[j].ExtendedFieldType:=eftEnum; Bindings[j].ExtendedFieldType:=eftEnum;
end; 'citext':
Bindings[j].ExtendedFieldType:=eftCitext;
end;
Dec(J);
end; end;
end; end;
finally finally
@ -1152,6 +1153,10 @@ begin
FD.DataType:=ftString; FD.DataType:=ftString;
FD.Size:=64; FD.Size:=64;
//FD.Attributes:=FD.Attributes+[faReadonly]; //FD.Attributes:=FD.Attributes+[faReadonly];
end;
eftCitext:
begin
FD.DataType:=ftMemo;
end end
else else
if ErrorOnUnknownType then if ErrorOnUnknownType then