You are not logged in.
Pages: 1
Hello,
The sqlite3 DB file is created as below:
TTest1 = class(TOrm)
...
end;
TTest2 = class(TOrm)
...
end;
...
function CreateTestModel: TOrmModel;
begin
result := TOrmModel.Create([TTest1, TTest2]);
end;
If i just know one table "TTest1", and have no information about "TTest2",
how can i access to the "TTest1" from the DB file?
Is there any function to access using table name in the DB file?
Please give me some advise.
Thanks in advance
Offline
What do you mean?
Do you mean that TTest2 has no property defined?
I don't understand what you want to do.
It is not possible to access something the ORM don't know about.
What you can always do is running a manual SQL statement over the database.
Or if you want to change the table name at startup for TTest2, then you can define TTest2 as external, and specify the table name in OrmMapExternal() just before CreateMissingTables().
Offline
Hi, ab.
The TTest1 is defined in all of my sqlite files commonly.
Also, TTest2, TTest3 etc. is defined in each sqlite files with TTest1.
In this case, i just want to make a simple function to access only TTest1 over the db files without caring about other ORM like as TTest2, TTest3....
function SimpleAccessTest1(ADBFileName: string);
begin
...
UpdateTest1(ADBFileName);
end;
Offline
So use OrmMapExternal() for each TTest2, TTest3, etc... to access the 'test1' table.
But I don't see any use case for it....
You can do it at object pascal level by defining
type TTest2 = TTest1;
TTest3 = TTest1; ...
Offline
Pages: 1