#2 mORMot 1 » Latest trunk 9b283604c69eb29e rowCount broken » 2020-03-31 16:03:33

rain
Replies: 2

Hi,
I use mormot with Delphi 2007,  Anydac  and firebird with the latest trunk i get rowCount with decimal :

{u'rowCount': 0.833333333333333, u'fieldCount': 6, ...



thank you

#3 Re: mORMot 1 » strange behaviour of TSynDBDataSet with Firebird using Firedac » 2016-09-21 13:02:26

Hi,
I have found a possible cause in SynDBMidasVCL the TSynDBDataSet use a Dataset TSynDBSQLDataSet associated with the TDataSetProvider. If I override the InternalInitFieldDefs procedure of TSynDBSQLDataSet seem to work correctly



procedure TSynDBSQLDataSet.InternalInitFieldDefs;
var F: integer;
  DBType: TFieldType;
  lFields: TSQLDBColumnDefineDynArray;
begin

  FieldDefs.Clear;
  if fconnection = nil then
    exit;

  fconnection.GetFields(PSGetTableName, lFields);
  for F := Low(lFields) to High(lFields) do
  begin
    with lFields[F] do
    begin
      case ColumnType of
        SynCommons.ftInt64:
          begin
            DBType := db.ftLargeint;
          end;
        SynCommons.ftDate:
          begin
            DBType := db.ftDateTime;
          end;
        SynCommons.ftUTF8:
          begin
            if ColumnLength = 0 then
            begin
              DBType := db.ftWideMemo;
            end
            else
            begin
              DBType := db.ftWideString;
            end;

          end;
        SynCommons.ftBlob:
          begin
            DBType := db.ftBlob;
          end;
        SynCommons.ftDouble, SynCommons.ftCurrency:
          begin
            DBType := db.ftFloat;
          end
      else
        raise EDatabaseError.CreateFmt('GetFieldData ColumnType=%d', [ord(ColumnType)]);
      end;
      FieldDefs.Add(UTF8ToString(ColumnName), DBType, ColumnLength);
    end;
  end;
  setLength(lFields, 0);
end;

#4 mORMot 1 » strange behaviour of TSynDBDataSet with Firebird using Firedac » 2016-09-20 09:54:38

rain
Replies: 1

Hi,

I have derived a simple component from TSynDBDataSet to override InternalInitFieldDefs procedure.

The component seem work fine except when I edit a record with 2 VarChar(2) field one with '13' and the next empty if the field are on a form with 2 Dbedit and I use Tab to cycle from Dbedit to another the value of the first field is copied to the next field.





procedure TMyMemDataSet.InternalInitFieldDefs;
var
  lFields: TSQLDBColumnDefineDynArray;
  DBType: TFieldType;
  F: integer;
begin

  if FieldDefs.Count > 0 then
    exit;

  if Connection = nil then
    exit;
  Connection.GetFields(PSGetTableName, lFields);
  for F := Low(lFields) to High(lFields) do
  begin
    with lFields[F] do
    begin
      case ColumnType of
        SynCommons.ftInt64:
          begin
            DBType := db.ftLargeint;
          end;
        SynCommons.ftDate:
          begin
            DBType := db.ftDateTime;
          end;
        SynCommons.ftUTF8:
          if (ColumnLength = 0)  then
          begin
            DBType := db.ftWideMemo;
          end
          else
          begin
            DBType := db.ftWideString;
          end;
        SynCommons.ftBlob:
          begin
            DBType := db.ftBlob;
          end;
        SynCommons.ftDouble, SynCommons.ftCurrency:
          begin
            DBType := db.ftFloat;
          end
      else
        raise EDatabaseError.CreateFmt('GetFieldData ColumnType=%d', [ord(ColumnType)]);
      end;
      FieldDefs.Add(UTF8ToString(ColumnName), DBType, ColumnLength);
    end;
  end;
  setLength(lFields, 0);

end;

p.s. I'm using Delphi XE 10.1

TIA

#6 Re: mORMot 1 » Modularization of application with interfaces and dll (or bpl?) » 2016-06-06 15:39:46

Thank you AB for the reply, good I wait for the new example.
I like DDD approach but I'm little confused on using it on very big application and how define contracts to write less code: i.e. write general interfaces like IRemoteSQL (validations? authorizations?) or an interface for every object.

#7 mORMot 1 » Modularization of application with interfaces and dll (or bpl?) » 2016-06-06 13:50:28

rain
Replies: 24

Hi,

I need to rewrite a very big application with a legacy Firebird database using Delphi XE (now I’m using Delphi 2007).

The source code is over 2M lines of code and since the application contains more than 400 forms I need to separate it into different modules.

For the new application I need two things :

· separate the business logic from the forms (Views)

· create just a few modules that manages the application core parts. For example one module for the orders management,another one for the warehouse management,another one for the sells.

Is there a best practices for load plug-in (DLL or BPL) using interfaces for the Business logic?

Which is the correct way to use the mORMot solution ?   Can I modularize mORMot validations and queries  ?


For the forms I think to use this approach http://delphi.cjcsoft.net/viewthread.php?tid=44129 or similiar   (I had tried Jedi plug-in and TMS)

thank you in advance

#8 Re: Low level and performance » Fast TStringList » 2014-07-12 11:45:50

Hi to all I'm new here,
I'm  using the alcinoe implementaions of TStringList: TALStringList and TALAVLStringList are quite fast. Look at xml parser is fast too.

http://sourceforge.net/projects/alcinoe/

I love the mORMot framework is a very good work, thank you A.B.

Board footer

Powered by FluxBB