#1 2012-05-05 10:31:38

esmondb
Member
From: London
Registered: 2010-07-20
Posts: 299

authentication across multiple SQLite DBs on single server

I'm trying to create a HTTP server with more than one SQLite DB using authentication. It's initilised using the code below but this gives the exception 'table AuthUser already exists' when the line DB3.CreateMissingTables(0); is called (each model has a different root).

How should I be handling authentication when there's more than one DB file?

Thanks

procedure TForm1.FormCreate(Sender: TObject);
begin
  Model1 := CreateModel1;
  Model2 := CreateModel2;
  Model3 := CreateModel3;
  DB1 := TSQLRestServerDB.Create(Model1,'C:\DATA\data1.db3',true);
  DB2 := TSQLRestServerDB.Create(Model2,'C:\DATA\data2.db3',false);
  DB3 := TSQLRestServerDB.Create(Model3,'C:\DATA\data3.db3',true);
  DB1.CreateMissingTables(0);
  DB2.CreateMissingTables(0);
  DB3.CreateMissingTables(0);
  Server := TSQlite3HttpServer.Create('8080',[DB1, DB2, DB3]);
end;

Offline

Board footer

Powered by FluxBB