You are not logged in.
Hi,
I would like to install the server mORMot (SQLite DB) in a VPS (Linux CentOS or Debian)
Do you have any plans for when you want to support Lazarus?
Congratulations to mORMot
Dear admin,
. BusyTimeout does not work...
I try to enter a value greater than 0 but does not work.
vdb: = TSQLRestServerDB.Create (dm.Model, StringToUTF8 ('base');
vdb.DB.BusyTimeout: = 2000;
excuse me.
The property BusyTimeout works perfectly.
The confusion was mine.
Dear admin,
. BusyTimeout does not work...
I try to enter a value greater than 0 but does not work.
vdb: = TSQLRestServerDB.Create (dm.Model, StringToUTF8 ('base');
vdb.DB.BusyTimeout: = 2000;
Hello,
could someone be kind enough to write a few lines of code using the function sqlite3_busy_handler?
Dear admin,
you can implement the routine to sets a callback function busy_handler in TSQLDataBase?
Thanks
Guess I didn't read the small letters in the documentation :-).
Thanks for the info, Arnaud.Cheers,
Wai
Hello, Could you post the solution to your problem?
Thus facilitate the understanding to others.
Thank you for your kindness
Hi,
Could you provide the sources of this great example?
I am from Brazil too.
Hello admin,
I wonder whether you can use this framework on Amazon EC2.
Has anyone installed a virtual machine in the cloud?
Thank you for your attention.
Dear administrator
I think I found a bug in the "TSQLRequest.PrepareNext"
I think the right way is:
function TSQLRequest.PrepareNext: integer;
begin
if (Request=0) or (fNextSQL^=#0) then
result := SQLITE_DONE else begin
Close; // free previous statement
result := sqlite3_prepare_v2(RequestDB, fNextSQL, -1, fRequest, fNextSQL);
while (result=SQLITE_OK) and (Request=0) and (fNextSQL^<>#0) do // comment or white-space
result := sqlite3_prepare_v2(RequestDB, fNextSQL, -1, fRequest, fNextSQL);
fFieldCount := sqlite3_column_count(fRequest);
sqlite3_check(RequestDB,result); //This function should do the checking before changing the value of result
//To be generated an exception if there is any error in the script
if Request=0 then
result := SQLITE_DONE; // nothing more to add
end;
end;My code that throws an exception correctly.
I would like you to tell me if I'm doing right this way
...
s := TStringList.Create;
s.Add('BEGIN;');
s.Add('INSERT INTO XXX(nome) VALUES("TEST1");');
s.Add('INSERT ERR XXX(nome) VALUES("TEST2");'); // <<<ERROR
s.Add('INSERT INTO XXX(nome) VALUES("TEST3");');
s.Add('COMMIT;');
try
r.ExecuteAll(db.DB, s.Text);
except
on E : Exception do begin
r.Execute(db.DB, 'rollback;') ;
ShowMessage( E.Message);
end;
end;
r.Close;
s.Free;
end;Dear administrator,
I think I found a bug in the "TSQLRequest.PrepareNext"
I think the right way is:
function TSQLRequest.PrepareNext: integer;
begin
if (Request=0) or (fNextSQL^=#0) then
result := SQLITE_DONE else begin
Close; // free previous statement
result := sqlite3_prepare_v2(RequestDB, fNextSQL, -1, fRequest, fNextSQL);
while (result=SQLITE_OK) and (Request=0) and (fNextSQL^<>#0) do // comment or white-space
result := sqlite3_prepare_v2(RequestDB, fNextSQL, -1, fRequest, fNextSQL);
fFieldCount := sqlite3_column_count(fRequest);
sqlite3_check(RequestDB,result); //This function should do the checking before changing the value of result
//To be generated an exception if there is any error in the script
if Request=0 then
result := SQLITE_DONE; // nothing more to add
end;
end;My code that throws an exception correctly.
I would like you to tell me if I'm doing right this way
...
s := TStringList.Create;
s.Add('BEGIN;');
s.Add('INSERT INTO XXX(nome) VALUES("TEST1");');
s.Add('INSERT ERR XXX(nome) VALUES("TEST2");'); // <<<ERROR
s.Add('INSERT INTO XXX(nome) VALUES("TEST3");');
s.Add('COMMIT;');
try
r.ExecuteAll(db.DB, s.Text);
except
on E : Exception do begin
r.Execute(db.DB, 'rollback;') ;
ShowMessage( E.Message);
end;
end;
r.Close;
s.Free;
end;How do I run the script below as a transaction
s: = TStringList.Create;
s.Add ('BEGIN;');
s.Add ('INSERT INTO title (name) VALUES (' TEST ');');
s.Add ('INSERT1 INTO title (name) VALUES (' TEST ');');
s.Add ('END');
SQLite3DB.ExecuteNoResult (s.Text, []);I think it should return an exception but it does not.
But for SQLite that will be only one transaction?
In other words: No need to start a transaction in order to run all or not run anything if there is a problem?
How would I do to properly execute the code below?
So that I received the error regarding the "frontier" what is wrong
var
st: TStringList.
r: TSQLRequest;
Begin;
st: = TStringList.Create;
begin with the st
Add ('BEGIN')
Add ('CREATE TEMP TABLE test (cod INTEGER, name VARCHAR (50));');
Add ('INSERT INTO test values (1, "alex");');
Add ('DELETE fron cod where test = 1;');
Add ('INSERT INTO test values (1, "alex");');
Add ('END');
end;
Dear administrator,
When I have multiple commands within a Begin, End, and one of the commands is wrong, I would have it generated an exception regarding the error.
Example:
When you run the lines below, the function: "function TSQLRequest.Prepare (" does not return the error on the line "DELETE fron cod where test = 1;"
BEGIN;
CREATE TEMP TABLE test (cod INTEGER, name VARCHAR(50));
INSERT INTO test values (1, 'alex');
DELETE fron test where cod = 1;
INSERT INTO test values (1, 'alex');
END;
I believe that there can be a change in function
function TSQLRequest.Prepare(DB: TSQLite3DB; const SQL: RawUTF8): integer;
begin
fDB := DB;
fRequest := 0;
if DB=0 then
raise ESQLException.Create(DB,SQLITE_CANTOPEN);
result := sqlite3_prepare_v2(RequestDB, pointer(SQL), length(SQL)+1, fRequest, fNextSQL);
while (result=SQLITE_OK) and (Request=0) do // comment or white-space
result := sqlite3_prepare_v2(RequestDB, fNextSQL, -1, fRequest, fNextSQL);
fFieldCount := sqlite3_column_count(fRequest);
sqlite3_check(RequestDB,result);
end;If I run the commands without the "Begin, End," is not returned any errors.
I hope you understood what I wanted to show.
Thank you!
What I wanted was to save and retrieve a component Tkbmmentable with the data in the SQLite and now I get with these changes you made in synSQLite3 unit.
This is an excellent project.
Thank you,
I solved this problem with your help.
You can show me an example of how to write in a SQLite TMemoryStream.
Something like:
procedure UpdateBlob(const SQL: string; BlobStream: TMemoryStream);
begin
...
end;
Hello administrator,
Can you create within SynSQLite3.pas a function to return a TMemoryStream directly.
It would be like:
TSQLRequest.FieldBlob function (Col: integer): RawByteString;
something like:
TSQLRequest.FieldBlob function (Col: integer): TMemoryStream;
Or someone shows me how to create a function to it.
I appreciate any help.
If we could add a unit to generate bar code would be interesting right?
I understood, but create the bar code is still not possible?
Would give a code example?
In the example below, how can I import a jpg or bmp file?
I tried several form but got no success.
procedure TForm1.btn1Click(Sender: TObject);
var i: integer;
begin
with TGDIPages.Create(self) do
try
// the title of the report
Caption := self.Caption;
// now we add some content to the report
BeginDoc;
// header and footer
AddTextToHeader(paramstr(0));
SaveLayout;
Font.Style := [fsItalic];
TextAlign := taRight;
AddTextToFooterAt('http://synopse.info',RightMarginPos);
RestoreSavedLayout;
AddTextToFooter(DateTimeToStr(Now));
// main content (automaticaly split on next pages)
NewHalfLine;
DrawTitle(edt1.Text,true);
for i := 1 to 10 do
DrawText('This is some text '+IntToStr(i));
NewLine;
AddColumns([10,20,50]);
AddColumnHeaders(['#','Two','Three'],true,true);
for i := 1 to 100 do
DrawTextAcrossCols([IntToStr(i),'Column '+IntToStr(i),'Some text here']);
NewLine;
DrawTitle('This is your text:');
DrawText(mmo1.Text);
EndDoc;
// this method will show a preview form, and allow basic actions
// by using the right click menu
ShowPreviewForm;
finally
Free;
end;
end;
Administrator,
How do you add a bmp image in this example with TGDIPages?
Something like:
Var
image: TBitmat;
image: TBitmap.Create = (nil)
image.LoadFromFile ('c: \ ...
I appreciate your help
Eraldo