Cannot get work the xdata apache module for other db conenctions than sqlite (from the example)
initialization
Server := TWebBrokerServer.Create;
//---------------------------------------------------
TDatabaseManager.Update(TUniDacMySqlConnection.CreateConnection);
Server.Dispatcher.AddModule(TXDataServerModule.Create(
'http://xdata.mycloud.si/tms/xdata', TUniDacMySqlConnection.CreateConnection
));
// add modules you want to use. This example assumes a simple Sparkle module,
// but you can add your XData, RemoteDB or any other Sparkle module
Server.Dispatcher.AddModule(TAnonymousServerModule.Create(
'http://xdata.mycloud.si/tms/hello',
procedure(const C: THttpServerContext)
begin
C.Response.StatusCode := 200;
C.Response.ContentType := 'text/plain';
C.Response.Close(TEncoding.UTF8.GetBytes('Hello from Sparkle!'));
end
));
finalization
Server.Free;
Server := TWebBrokerServer.Create;
//---------------------------------------------------
TDatabaseManager.Update(TUniDacMySqlConnection.CreateConnection);
Server.Dispatcher.AddModule(TXDataServerModule.Create(
'http://xdata.mycloud.si/tms/xdata', TUniDacMySqlConnection.CreateConnection
));
// add modules you want to use. This example assumes a simple Sparkle module,
// but you can add your XData, RemoteDB or any other Sparkle module
Server.Dispatcher.AddModule(TAnonymousServerModule.Create(
'http://xdata.mycloud.si/tms/hello',
procedure(const C: THttpServerContext)
begin
C.Response.StatusCode := 200;
C.Response.ContentType := 'text/plain';
C.Response.Close(TEncoding.UTF8.GetBytes('Hello from Sparkle!'));
end
));
finalization
Server.Free;
I m using unidac, and the unidac connection tester is working well under linux console,but when used in the example crashes (even without entities), have tried all kinds of database connection (Firedac, MSSQL Native) but none seems to work...
Any example would be the best.