mORMot and Open Source friends
Check-in [7e3ff4ad37]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:fixed issue with some kind of columns with TDataSet-based SynDB access thanks fabioquestor for the feedback and fix!
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 7e3ff4ad374ab35879913a681d141da53e51646d
User & Date: User 2014-05-19 18:37:43
Context
2014-05-19
19:53
introducing SynCrossPlatformJSON unit for feature request [09ae8513eb]
  • it is the first unit of Cross-Platform mORMot clients, running with FPC or Delphi NextGen compilers
  • it is able to create schema-less objects or arrays, serialize and unserialize them as JSON, via a custom variant type, including late-binding to access the properties (just like our TDocVariant, but cross-platform)
  • even if it is less optimized for speed and memory use than our TDocVariant, it is already much faster and using less resource than DBXJSON and XSuperObject (which are the only cross-platform JSON solutions we know about yet for Delphi), also faster than SuperObject under Windows - of course, dwsJSON is faster than this unit (but this latest is not cross platform), and FPC ready
  • code is simple to follow and should be easy to maintain
  • we will add
check-in: 0fc3a78a9d user: User tags: trunk
18:37
fixed issue with some kind of columns with TDataSet-based SynDB access thanks fabioquestor for the feedback and fix! check-in: 7e3ff4ad37 user: User tags: trunk
13:18
in JSON performance sample, TTestHugeContent.SynopseReadRecord will now handle GeoJSON types as an enumeration: used memory comes from 123 MB to 113 MB (and due to previous commit optimizing array allocation strategy, speed comes from 1.52 seconds down to 1.32 seconds) check-in: c650509bf2 user: User tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to SynDBDataset.pas.

537
538
539
540
541
542
543



544
545
546
547



548
549
550

551
552
553
554
555
556
557
558
559
560
561
562
563
564
begin
  case aNativeType of
    {$ifdef UNICODE}
    ftLongWord,ftShortint,ftByte,
    {$endif}
    ftAutoInc,ftBoolean, ftSmallint,ftInteger,ftLargeint,ftWord:
      result := SynCommons.ftInt64;



    ftFloat:
      result := SynCommons.ftDouble;
    ftCurrency, ftBCD, ftFMTBcd:
      result := SynCommons.ftCurrency;



    ftDate,ftTime,ftDateTime:
      result := SynCommons.ftDate;
    ftBlob:

      result := SynCommons.ftBlob;
    {$ifdef UNICODE}
    ftFixedWideChar,ftWideMemo,
    {$endif}
    ftString,ftFixedChar,ftWideString,ftMemo,ftFmtMemo:
      result := SynCommons.ftUTF8;
  else
      result := SynCommons.ftUTF8;
  end;
end;

function TSQLDBDatasetStatementAbstract.DatasetField(col: Integer): TField;
begin
  result := fQuery.Fields[col];






>
>
>




>
>
>
|

<
>




|

|







537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555

556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
begin
  case aNativeType of
    {$ifdef UNICODE}
    ftLongWord,ftShortint,ftByte,
    {$endif}
    ftAutoInc,ftBoolean, ftSmallint,ftInteger,ftLargeint,ftWord:
      result := SynCommons.ftInt64;
    {$ifdef UNICODE}
    ftSingle,ftExtended,
    {$endif}
    ftFloat:
      result := SynCommons.ftDouble;
    ftCurrency, ftBCD, ftFMTBcd:
      result := SynCommons.ftCurrency;
    {$ifdef UNICODE}
    ftOraTimeStamp,ftOraInterval,
    {$endif}
    ftDate,ftTime,ftDateTime,ftTimeStamp:
      result := SynCommons.ftDate;

    ftBytes,ftVarBytes,ftBlob,ftGraphic,ftOraBlob:
      result := SynCommons.ftBlob;
    {$ifdef UNICODE}
    ftFixedWideChar,ftWideMemo,
    {$endif}
    ftString,ftFixedChar,ftWideString,ftMemo,ftFmtMemo,ftOraClob,ftVariant,ftGuid:
      result := SynCommons.ftUTF8;
  else // will use TEXT for other fields (any feedback is welcome!)
      result := SynCommons.ftUTF8;
  end;
end;

function TSQLDBDatasetStatementAbstract.DatasetField(col: Integer): TField;
begin
  result := fQuery.Fields[col];