You are not logged in.
Pages: 1
hi AB
I have many DB Instance On SQL Server
How to access these database use mORMot?
Like this:
UserA access -> DB_0001
UserB access -> DB_0002
...more
Offline
HI,
each user must map a different root, which corresponds to a different db.
look at 'rtest':
MongoClient := TMongoClient.Create('localhost',27017);
DB := MongoClient.Database['testODM'];
Model := TSQLModel.Create([TSQLORM,TSQLauthUser,TSQLauthGroup]); // <<-------------------- root
MongoClient2 := TMongoClient.Create('localhost',27017);
DB2 := MongoClient2.Database['testODM2'];
Model2 := TSQLModel.Create([TSQLORM,TSQLauthUser,TSQLauthGroup],'rtest'); //<------------------------------------- rtest
// create the main mORMot server
aRestServer := TSQLRestServerDB.Create(Model,':memory:',false);
aRestServer2 := TSQLRestServerDB.Create(Model2,':memory:',false);
// serve aRestServer data over HTTP
aHttpServer := TSQLHttpServer.Create(SERVER_PORT,[aRestServer],'+',useHttpApiRegisteringURI);
aHttpServer.AddServer(aREstSErver2);
Offline
thanks Sabbiolina, ab
i also think create different root for every database. but SQL SERVE have more than 1000 instance
It's not a good solution
Offline
1000 instances of SQL Server would be much more resource consuming that a root for each database.
A TSQLRestServer instance won't consume a lot of resources, and the same unique TSQLHttpServer instance is able to handle 1000 roots without any issue.
IMHO 1000 instances of SQL Server sounds like a weird choice.
Offline
Pages: 1