You are not logged in.
Pages: 1
Hello,
I am using mORMot for storing project data.
The (simplified) model looks like this
TSQLProject = class(TSQLRecord)
protected
fName: RawUTF8;
published
property Name: RawUTF8 read fName write fName stored AS_UNIQUE;
end;
TSQLProjectID = type TID;
TSQLProduct = class(TSQLRecord)
protected
fModel: RawUTF8;
fProject: TSQLProjectID;
fCreatedAt: TDateTime;
published
property Model: RawUTF8 read fModel write fModel;
property Project_ID: TSQLProjectID read fProject write fProject;
property CreatedAt: TDateTime read fCreatedAt write fCreatedAt;
end;
At this moment, all product are stored into this single Product table.
I would like to change this.
Is it possible to use runtime created tables ?
E.g:
I would like to store Products from 5 years and older into separate tables.
A single table for each year.
The old tables will be stored on a standard disk.
The more recent tables will be stored on SSD.
Backups will also be made different, depending on age of product (table date).
Thanks !
Offline
Inherit from TSQLProduct to define a new class, then use this new class to define a table with older data.
type
TSQLProductArchived = class(TSQLProduct);
Then register this TSQLProductArchived as external table on another SQLite3 instance, which file would be stored on a standard disk.
Your application has to perform the archival process, i.e. moving data from TSQLProduct to TSQLProductArchived, on itself, e.g. every end of month.
Use a BatchAdd() to insert the archived products on the TSQLProductArchived table with maximum speed.
Offline
Thanks ! I will give it a go !!
Offline
Pages: 1