You are not logged in.
Pages: 1
Hello everyone,
I guess I'm having another thought mistake. I create a backup of the databases with the function BackupBackground(). That works wonderfully!
Now I ask myself the question, how is the restore done? In the sources I see that the function Restore() should not be used and it is referred to the function BackupBackground(). But this is only for creating the backup and not for restoring or do I see this wrong?
For a push in the right direction I thank you in advance!
Olaf
Great, thank you very much!!!!
Olaf
Hello, everyone,
is it possible to create a join of two tables if the tables are located in two different SQLITE3 databases?
Thank you very much in advance,
Olaf
Hello, everyone,
first of all I would like to thank you for providing the framework! I have worked my way through a few weeks now and am more than enthusiastic!!
My question/problem:
I have the following definition for my table (here a simple example):
type
TSQLRecordTimeStamped = class(
TSQLRecord )
private
fUsername: RawUtf8;
published
property Username: RawUtf8 read fUsernamewrite fUsername;
end;
type
TSQLTitle = class(
TSQLRecordTimeStamped )
private
fName: RawUtf8;
published
property Name: RawUtf8 read fName write fName;
end;
Create model:
model.create( TSQLRecordHistory, TSQLTitle);
Enable History:
database.TrackChanges( [ TSQLTitle ] );
Everything's going great. I just have a problem. When a record is changed, only the value of the Name field is logged. The value of the field "Username" (inherited field) is not logged.
Am I doing something wrong or do I have a mental error?
Thank you in advance
Olaf
Hello, me again,
I found it. The following parameter must be set.
Great and thank you very much
Olaf
DB.Options := [rsoAddUpdateReturnsContent];
Hello Esteban,
unfortunately not.
Chrome time the following:
General:
Request URL:http://b6996c001.4all-media.root:8990/V1/MAS/Title/
Request Method:POST
Status Code:201 Created
Remote Address:169.254.63.187:8990
Referrer Policy:no-referrer-when-downgrade
Response Header
HTTP/1.1 201 Created
Location: Title/23
Server: mORMot (Windows) Microsoft-HTTPAPI/2.0
X-Powered-By: mORMot 1.18 synopse.info
Server-InternalState: 28
Access-Control-Allow-Methods: POST, PUT, GET, DELETE, LOCK, OPTIONS
Access-Control-Max-Age: 1728000
Access-Control-Expose-Headers: content-length,location,server-internalstate
Access-Control-Allow-Origin: *
Accept-Encoding: synlz,gzip
Date: Fri, 17 Nov 2017 15:55:18 GMT
Content-Length: 0
Requerst Header
POST /V1/MAS/Title/ HTTP/1.1
Host: b6996c001.4all-media.root:8990
Connection: keep-alive
Content-Length: 33
Pragma: no-cache
Cache-Control: no-cache
Origin: http://b6996c001.4all-media.root:1841
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36
Content-Type: application/json
Accept: */*
DNT: 1
Referer: http://b6996c001.4all-media.root:1841/?locale=de/
Accept-Encoding: gzip, deflate
Accept-Language: de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7
Request Payload
{"Name":"Test 3","Active":"true"}
I don't understand. The search continues...; -)
But despite everything, thank you very much!
Olaf
Hello,
I have another problem and hope that someone can give me a clue.
I send a new record to the REST server from the browser via Ext.Ajax.request. The dataset is created and I get a response message that the dataset is being created. The response also contains the data I sent. What I miss is the record ID that was assigned when the record was created.
I hope I was able to explain the problem reasonably by then!?
How do I get the REST server to send me the ID of the created record back without having to set an interface function?
I would like to thank you in advance
Olaf
Oh thank you very much for the helpful hint! That helps me a lot!
Hello everyone,
I have the following understanding problem.
In my database field I store a JSON array:
Field names:
Filter, Type: RawUtf8
TestData, Type: Variant;
Field content:
Filter: Filter = Test
TestData: {"Contents":[{ID: 1, Data:"Test"}, {ID: 2, Data:"Help"}]}}
The line with the required data set is filtered via "Filter = Test" and gets the JSON value.
I hope by then I have been able to explain this clearly. :-)
Well, my problem:
How can I filter within the JSON array after ID = 2 filters?
In the documentary. I read about the function JsonGet (). But unfortunately I can't find an example of how to understand it.
Can someone give me a little example?
Many thanks in advance
Olaf
Hello, Ab,
Thank you very much now I have understood it! : -)
Hello Chaa,
thank you very much! This has already helped me once before.
However, I still have a problem with understanding. I use the "Postman" program to make test calls. If I refer to the API "Add1" and transfer the parameters from "Data={N1:5, N2:13}" as form-data, they will not be forwarded within the server.
Only if I transfer them as "RAW" format, they can be read within the function.
In plain language:
URL
http://localhost:8888/root/Calculator.add1
...
Form-Data
Data: {N1:5, N2:13}
In the server in the function "Add1" the parameter "Data" is empty.
...
RAW
{Data: {"n1": 10,"n2": 2}}}
In the server in the function "Add1" the parameter "Data" is filled.
Since I'm moving quite new in the REST server world, it's a little hard for me to do that. Unfortunately, my search via Google has not been successful so far.
Thank you in advance for any help!!!!
regards
Olaf
Hello,
in the example "14 - Interface based services" I added a function "Add1":
function Add1(const Data: TRecTest): integer;
Die Parameter N1 und N2 habe ich in einem Record definiert:
type
TRecTest = packed record
n1: integer;
n2 : integer;
end;
I now want to receive the JSON string sent by the client via the parameter of the funtion.
From Client comes:
http://localhost:8888/root/Calculator.add1/?n1=1&n2=2
In function "Add1":
...
result := Data.n1 + Data.n2;
...
I tried everything but the record "Data" is always "empty". What am I doing wrong?
I would be very, very grateful if someone could help me.
Thank you very much
Olaf
PS:
Please excuse my bad english!
Hello,
When I run the following command on the client side, the SQL statement is not executed. Can someone give me a tip, what I do wrong?
This is the command I want to run:
TSQLRestClientURI.Execute('UPDATE TblTest SET Field1 = 2')
TSQLRestClientURI.Execute returns False
Many thanks
Olaf
Yes, everything is created in a thread. What I noticed but is that the problem no longer occurs, when I encounter the error, Delphi [10.2] terminate and restart.
I keep watching this and when I can tell you what exactly.
Thank you!
Hello everyone,
I have the problem that I get the error "Erste Gelegenheit für Exception bei $766FB802. Exception-Klasse ESynException mit Meldung 'TSQLLocRelationship.AutoTable VMT entry already set'. Prozess ScCtr.exe (14648)" sporadically at the start of my service. Interestingly, the error occurs in 10 starts only 2 times.
SQLite3 is used as a database and it does not matter whether it exists or is created only at startup. The error comes with both variants.
It is also not always the same table. Currently, the error occurs in the TSQLLocRelationship table. The next time it will be the table "XYZ".
Can I possibly give a hint so I can solve this problem?
Thanks
Olaf
Pages: 1