Skip to content

Commit

Permalink
Merge pull request #39 from mateusvicente100/master
Browse files Browse the repository at this point in the history
Identify blob field
  • Loading branch information
viniciussanchez committed Apr 23, 2020
2 parents ad5581d + eab56ec commit 59ed56d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/core/DataSet.Serialize.Import.pas
Original file line number Diff line number Diff line change
Expand Up @@ -422,8 +422,14 @@ procedure TJSONSerialize.LoadFieldsFromJSON(const ADataSet: TDataSet; const AJSO
with ADataSet.FieldDefs.AddFieldDef do
begin
Name := JSONPairToFieldName(LJSONPair);
DataType := ftString;
Size := 4096;
if Length(LJSONPair.JsonValue.Value) > Size then
begin
Size := Length(LJSONPair.Value);
DataType := ftBlob;
end
else
DataType := ftString;
end;
end;
end;
Expand Down

0 comments on commit 59ed56d

Please sign in to comment.