You are not logged in.
Pages: 1
Hello,
I would like to pass the select statement with params from the web browser. The backend uses THttpApiServer to serve the json response. The JSONSQLClient demo works fine when I pass the plain query statement without params through the body.
Is this possible to pass for example json with params such as:
{
"query":"select * from users where name=? and id > ?",
"params":["john","6"]
}
Offline
No, it is not.
You would need to adjust the sample code.
But I would warn against such remote execution of arbitrary SQL, for several reasons: mostly architecture (switch to n-Tier) and security (executing any kind of select is unsafe).
I suspect you are reinventing the wheel.
Check https://synopse.info/files/html/Synopse … l#TITL_131
Offline
8.2.6. Remote access via HTTP
"The transmission protocol uses an optimized binary format..." , how can I send query from web browser and retrieve results? I suppose the SynDBRemote is a solution for pure delphi client-server apps.
Offline
Yes, SynDBRemote is for Delphi/FPC clients.
For the browser, there is no built-in solution, since it is weak in architecture, and unsafe.
You can adjust/expand the sample code, if you really want it. But we won't put it in the framework official code - as a 3rd party sample perhaps.
Offline
Pages: 1