#1 2013-02-07 11:12:17

piotrkbydg
Member
Registered: 2013-02-07
Posts: 2

Problem with TSQLRecordRTree

Hi,

I tried to create a RTree Index, but I get an exception when creating a tables : "No registered module for TSQLRecordProperties".

My test code :

...
type
  TDoublePoint=packed record
    x,y:double;
  end;

  TSQLPoint=class(TSQLRecord)
  private
    Fname:RawUTF8;
    Fxy:TDoublePoint;
  published
    property xy:TDoublePoint read Fxy write Fxy;
    property name:RawUTF8 read Fname write Fname;
  end;

  TSQLPointBox=class(TSQLRecordRTree)
  protected
    Fminx:Double;
    Fmaxx:Double;
    Fminy:Double;
    Fmaxy:Double;
  public
    class procedure BlobToCoord(const InBlob; var OutCoord: TSQLRecordTreeCoords);override;
  published
    property minx:Double read Fminx write Fminx;
    property maxx:Double read Fmaxx write Fmaxx;
    property miny:Double read Fminy write Fminy;
    property maxy:Double read Fmaxy write Fmaxy;
  end;

  TMainForm = class(TForm)
    btnCreate: TButton;
    procedure btnCreateClick(Sender: TObject);
  private
    procedure CreateDB;
  public
    { Public declarations }
  end;

var
  MainForm: TMainForm;

implementation

{$R *.dfm}

class procedure TSQLPointBox.BlobToCoord(const InBlob;
  var OutCoord: TSQLRecordTreeCoords);
begin
  OutCoord[0].min:=TDoublePoint(InBlob).x;
  OutCoord[0].max:=TDoublePoint(InBlob).x;
  OutCoord[1].min:=TDoublePoint(InBlob).y;
  OutCoord[1].max:=TDoublePoint(InBlob).y;
end;

procedure TMainForm.CreateDB;
var
  model:TSQLModel;
  server:TSQLRestServerDB;
begin
  model:=TSQLModel.Create([TSQLPoint,TSQLPointBox]);
  try
    server:=TSQLRestServerDB.Create(model,'localdb.db3',False,'');
    if(Assigned(server)) then
    begin
      try
        server.CreateMissingTables(0);  ---> "No registered module for TSQLRecordProperties".     
      finally
        server.Free;
      end;
    end;
  finally
    model.Free;
  end;
end;

procedure TMainForm.btnCreateClick(Sender: TObject);
begin
  CreateDB;
end;


Is there anything else I need to do before "server.CreateMissingTables(0);" ?

Thank you

Offline

#2 2013-02-07 22:47:55

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

Re: Problem with TSQLRecordRTree

Do you use the latest 1.18 unstable version from http://synopse.info/fossil/wiki?name=Get+the+source ?

Offline

#3 2013-02-08 10:31:27

piotrkbydg
Member
Registered: 2013-02-07
Posts: 2

Re: Problem with TSQLRecordRTree

I downloaded the latest version (2013-02-07 20:51:25), and also get an exception.
Tables created with class "TSQLRecord" work correctly.
I use Delphi7 Pro.

Offline

#4 2013-02-08 13:15:31

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

Re: Problem with TSQLRecordRTree

Please create a ticket, so that I do not forget to fix it.
http://synopse.info/fossil/tktnew

Offline

Board footer

Powered by FluxBB