You are not logged in.
Pages: 1
Very cool. Many thanks
Alright. Thank you!
I would like to store the data as RawBlob in a database. Are there some functions in the mormot framework to handle base64 to RawBlob and RawBlob to Base64 conversion for storage in a TOrm class?
Hello,
I define a procedure in a mormot2 interface based service like this:
procedure blobTest(const input: RawBlob; out output: RawBlob); //will accept and return binary format
Is there some way to make this work with a UTF-8 encoded BASE64 format instead, for access from a java (android) client?
It works now, nice!
Thank you.
Seems to have something to do with the 'localtime' parameter in the sqlite datetime function.
procedure Test();
var connection: TSQLDBSQLite3ConnectionProperties;
query1, query2: String;
begin
query1 := 'SELECT datetime(current_timestamp,''localtime'');'; //works only on linux
query2 := 'SELECT datetime(current_timestamp);'; //works on linux and windows
connection := TSQLDBSQLite3ConnectionProperties
.create(ExeVersion.ProgramFilePath+'Test.db','','','');
try
with connection.Execute(query1,[]) do begin
if step then showmessage(TimeToStr(ColumnDateTime(0))); //ColumnDateTime(0) returns 0 on windows, works on linux
ReleaseRows;
end;
finally
connection.free;
end;
end;
Any ideas?
Thanks.
But that's not it. I'm using FPC 3.2.0
If I use "tim" instead of "t" the problem persists.
I made a little sample procedure to illustrate my problem.
The following code works fine on Linux however on Windows I get an exception:"could not convert variant of type (Null) into type (String)"
I am using Lazarus 2.0.10 and the latest mORMot from github
procedure Test();
var connection: TSQLDBSQLite3ConnectionProperties;
V: Variant;
s: String;
begin
connection := TSQLDBSQLite3ConnectionProperties
.create(ExeVersion.ProgramFilePath+'Test.db','','','');
try
with connection.Execute('SELECT strftime(''%H:%M'',datetime(current_timestamp,''localtime'')) as t;',[],@V) do begin
while Step do begin
s := v.t; //could not convert variant of type (Null) into type (String) , only occurs on windows
showMessage(s);
end;
ReleaseRows;
end;
finally
connection.free;
end;
end;
What am I missing?
Pages: 1