#1 2012-09-10 10:05:30

Bascy
Member
From: The Netherlands
Registered: 2012-06-22
Posts: 108

Suggestion to add to TSQLModel

Why not add a generic method to TSQLModel to register all tables of the model externally to a TSQLConnectionPropertes?

procedure TSQLModel.RegisterAllTablesExternal(aProps: TSQLDBConnectionProperties);
var
  i: integer;
begin
  for i := Low(Tables) to High(Tables) do
    VirtualTableExternalRegister(Self, Table[Tables[i].SQLTableName], aProps, Tables[i].SQLTableName);
end;

Offline

#2 2012-09-10 12:06:15

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,660
Website

Re: Suggestion to add to TSQLModel

As such, it will add a dependency in SQLite3Commons to the SQLite3DB unit and SynDB, which IMHO is not very SOLID.

So I've added a new  VirtualTableExternalRegisterAll() function, to register all tables of a mORMot model to be handled via a specified database, in SQLite3DB.
See http://synopse.info/fossil/info/e2daa30b9c

Thanks for the feedback.

Offline

#3 2012-09-10 12:17:57

Bascy
Member
From: The Netherlands
Registered: 2012-06-22
Posts: 108

Re: Suggestion to add to TSQLModel

Even though i don't like public functions, I understand you sticking to SOLID principles ;-)

Offline

Board footer

Powered by FluxBB