#1 Re: mORMot 1 » 64 bits compilation under Linux OS » 2017-10-17 07:20:41

turrican wrote:
Thomas-Acia wrote:

I'm using CodeTyphon

Avoid Codetyphon. Try to use NewPascal instead

Ok thank you ! I'll test that !

#2 mORMot 1 » 64 bits compilation under Linux OS » 2017-10-16 12:57:18

Thomas-Acia
Replies: 3

Hi,

I have been working with mormot for 2 years now and I always compiled my programs under a 32 bits OS (Delphi 2010 then XE8 for Windows and Debian). But today, I encounter different problems so I have to compile some programs under a 64 bits Linux. I'm using CodeTyphon and my question is simple. Does mORMot compile under a 64 bits OS ?

I found this answer : https://synopse.info/forum/viewtopic.ph … 314#p20314 but it's old now.

Thank you !

#4 mORMot 1 » Access Violation [TDYNARRAY] » 2016-06-23 15:11:39

Thomas-Acia
Replies: 2

Hi,

I just update my mORMot sources. I didn't since a long time. I re-compiled one of my mORMot project and when I executed it, I had this error.
Do you have an idea about this ?

1466694487-error-syncommons.png

Thank's !

#5 mORMot 1 » JSONDecode of a array of json » 2016-02-19 10:10:12

Thomas-Acia
Replies: 1

Hi,

I would like to decode an array of json, for example this one :  [{"id":"1","nom":"test1.sql","dti":"2016-02-19 09:49:31"},{"id":"2","nom":"test2.sql","dti":"2016-02-19 09:50:12"}]

When I use the JSONDecode function : "JSONDecode(input, ['id'], output);" , I receive only id = 1. My question is simple, how can I receive an array of values.

Thank you

#7 Re: mORMot 1 » How to free a RawByteStringToStream » 2016-01-13 08:09:03

I do this :

  temp:=TStream.Create;    
  [...]
  temp := RawByteStringToStream(content);
  [...]
  temp.Free;    

but I have the feeling that the stream is not correctly released.

#8 Re: mORMot 1 » Database connection error with ZEOS » 2016-01-12 08:35:07

Hello,
I think you forgot the library driver.
You can find more informations here : http://synopse.info/files/html/Synopse% … #TITLE_182

#9 mORMot 1 » How to free a RawByteStringToStream » 2016-01-12 08:13:46

Thomas-Acia
Replies: 4

Hi,

I'm using the fonction "RawByteStringToStream" and I have a simple question: How to free this stream created ?

Thank's

#11 mORMot 1 » Question about the timeout delay » 2016-01-04 10:20:08

Thomas-Acia
Replies: 3

Hi Ab,

Firstly, I wish a Happy New Year to all mORMot'er !

If I'm not mistaken, the timeout to receiv the result of a CallBackGetResult is more or less 30 seconds.
Does exist a way to extend this delay ?

Thank you


Edit : I found the Default Timeouts in the SynCrtSock Unit

Edit 2: When I use "HttpRequest := THttpRequest.Create(IP, '83', False,'','',60000,60000,60000);", I have an abstract error.

#12 Re: mORMot 1 » FPC compilation problem(s) » 2015-12-07 09:22:18

Hi ab,
I would like to know if the support of x86-64 as a target for FPC under Linux is planned.
Thank you

#13 Re: mORMot 1 » 500 Internal Server Error When using custom authentication » 2015-09-28 07:05:59

@squirrel

Personnaly, when I had a 403 Error (Forbidden), I had a Model mistake. Check if you're calling your model on the server side with the right name.

#14 Re: mORMot 1 » How to start a Linux server in the background ? » 2015-09-18 06:59:32

Thank you for your help AOG. It will be very usefull

#15 mORMot 1 » How to start a Linux server in the background ? » 2015-09-17 11:51:12

Thomas-Acia
Replies: 11

Hi ab,

I would like to start my http server in the background on Linux. I tested ./SERVERNAME with '&' but it doesn't work. Do you have some ideas ?

Thank you

#16 Re: mORMot 1 » Setter uncalled in a TSQLRecord class » 2015-09-14 14:18:18

It's solved, I use now

aAttributes.Blob := aAttributes.Blob;

to call it explicity.

#17 mORMot 1 » Setter uncalled in a TSQLRecord class » 2015-09-14 12:34:43

Thomas-Acia
Replies: 2

Hi,

I need to call a Setter in a TSQLRecord class but it's uncalled. Is it because of the TSQLRawBlob type ??

type  
  TSQLAttributesRec = class(TSQLRecord)
  private
      fObjID, fPackedObj, fSize, fUseCount, fUnpackedObj :Integer;
      fExtension, fFilePath, fMimeType, fFName, fSha :RawUTF8;
      fBlob :TSQLRawBlob;
      procedure SetBlob(const Value:TSQLRawBlob);
  published
      property ObjID: Integer Read fObjID Write fObjID;
      property PackedObj: Integer Read fPackedObj Write fPackedObj;
      property Size: Integer Read fSize Write fSize;
      property UseCount: Integer Read fUseCount Write fUseCount;
      property UnpackedObj: Integer Read fUnpackedObj Write fUnpackedObj;
      property Extension: RawUTF8 Read fExtension write fExtension;
      property FilePath: RawUTF8 Read fFilePath write fFilePath;
      property MimeType: RawUTF8 Read fMimeType write fMimeType;
      property Name: RawUTF8 Read fFName write fFName;
      property Sha: RawUTF8 Read fSha write fSha;
      property Blob: TSQLRawBlob read fBlob write SetBlob;
   public
  end;
procedure TSQLAttributesRec.SetBlob(const Value:TSQLRawBlob);
begin
  ...
end;

I looked at this and I noticed that you used another class.

#18 Re: mORMot 1 » Retrieve a blob using mORMot » 2015-09-02 12:51:52

Finally, I used a TSQLRawBlob and the method : RetrieveBlob(). It works perfectly.
I have a last question. I sometimes have a problem with my server :
1441198258-sans-titre2.png

I think it's a problem with the PostgreSQL connection, maybe a timeout ??

Edit : I saw the ConnectionTimeOutMinutes method in the doc, I tried it, without success.

#19 Re: mORMot 1 » Retrieve a blob using mORMot » 2015-08-28 07:32:51

So do you think I can do that :

FTemplate.Text := aTemplate.bin;

Edit : When I do that: my text value is :
￰PGh0bWw+DQoNCjxzdHlsZSB0.....

#21 Re: mORMot 1 » Retrieve a blob using mORMot » 2015-08-28 07:07:23

 
  TSQLticket_template = class(TSQLRecord)
  private
      flibelle_template :RawUTF8;
      fbin :TSQLRawBlob;
      fblbid, fid_type_rapport :Integer;
  published
    property libelle_template: RawUTF8 Read flibelle_template Write flibelle_template;
    property bin: TSQLRawBlob Read fbin Write fbin;
    property blbid: Integer Read fblbid Write fblbid;
    property id_type_rapport: Integer Read fid_type_rapport Write fid_type_rapport;
  public
  end;

I think my TSQLRecord definition is right. I have a TSQLRawBlob. And then I don't know which args to use

#22 Re: mORMot 1 » Retrieve a blob using mORMot » 2015-08-27 14:27:00

I don't know know to fill all the arguments.
TSQLRecordClass = TSQLticket_template
aID =  idTemplate
const BlobFieldName : RawUTF8 = ??
BlobData : I think = aTemplate.bin

#23 Re: mORMot 1 » Retrieve a blob using mORMot » 2015-08-27 13:56:29

ab wrote:

For a BINARY blob, do not use RawByteString, but TSQLRawBlob published property.
Then get the blob explicitly: it is not retrieve by default with other fields.
Use TSQLRest.RetrieveBlob method instead.

See http://synopse.info/files/html/Synopse% … l#TITLE_59
and search for the BLOB keyword in the documentation.

But in your case, you want to store only text, I guess.

So use a plain RawUTF8 field, without any "index ###" length attribute.
It would be stored as a CLOB in th external DB.
And you have nothing special to do.

Yes, it's only a template which contains a text.

#24 Re: mORMot 1 » Retrieve a blob using mORMot » 2015-08-27 13:50:55

procedure TTicketClient.LoadTemplate2(idTemplate: Integer);
var
   aTemplate: TSQLticket_template;
begin
    aTemplate := TSQLticket_template.CreateAndFillPrepare(CTicket.Database, 'id = ?', [idTemplate]);
try
    while aTemplate.FillOne do
    begin
      TSQLRest.RetrieveBlob(TSQLticket_template,idTemplate, ??? ,aTemplate.bin);
    end;
finally
    aTemplate.Free;
 end;

 end;

Something like that ?

#25 Re: mORMot 1 » Retrieve a blob using mORMot » 2015-08-27 12:48:51

  TSQLticket_template = class(TSQLRecord)
  private
      flibelle_template :RawUTF8;
      fbin :RawByteString;
      fblbid, fid_type_rapport :Integer;
  published
    property libelle_template: RawUTF8 Read flibelle_template Write flibelle_template;
    property bin: RawByteString Read fbin Write fbin;
    property blbid: Integer Read fblbid Write fblbid;
    property id_type_rapport: Integer Read fid_type_rapport Write fid_type_rapport;
  public
  end;
procedure TTicketClient.LoadTemplate2(idTemplate: Integer);
var
   aTemplate: TSQLticket_template;
begin
    aTemplate := TSQLticket_template.CreateAndFillPrepare(CTicket.Database, 'id = ?', [idTemplate]);
try
    while aTemplate.FillOne do
    begin
      FTemplate.Text := aTemplate.bin;
    end;
finally
    aTemplate.Free;
 end;

 end;

I have that. But It seems like my FTemplate.text is empty

#26 mORMot 1 » Retrieve a blob using mORMot » 2015-08-27 12:02:14

Thomas-Acia
Replies: 15

Hi,

I had to do a project in order to create and print receipts. So I used mORMot + Mustache + WPTools + ZEOS.
I am at the end of my project. But I have a little problem with a blob. In fact, I sent my templates (created with mustache) on a PgSQL database. And now I would like to retrieve these blob using mORMot. On my database, the type is "bytea". So my question is : how can I retrieve the blob as text (because my template is html/css). Wich type can I use ?

Thank you

#27 Re: mORMot 1 » Problem when running in Windows Server mORMot Lazarus » 2015-07-22 07:01:40

Hello,

Personnally I use CodeTyphon. It is much like Lazarus. I had this error too. I don't know if it's the best way to solve it but :

- Go to the project options - analysis and change the mode. You can use : MODE DELPHI.

It solved my compilation errors.

Thormot

Edit 1 : 1437548584-sans-titre.png

Edit 2 : I had the same problem here : http://synopse.info/forum/viewtopic.php?id=2542

#28 Re: mORMot 1 » JOINed query » 2015-07-09 13:58:30

ERROR FOUND !

Line 45518 in mORMot.pas, we have to add oTSQLRecord :

if ClassHasPublishedFields(ClassType) or
       (JSONObject(ClassType,IsObjCustomIndex,[cpRead,cpWrite]) in
         [{$ifndef LVCL}oCollection,{$endif}oObjectList,oUtfs,oStrings,
          [color=#FF0000]oSQLRecord[/color],oException,oCustom]) then

You deleted this the 18th of June at 11:03.

1436450205-sans-titre.png

#29 Re: mORMot 1 » JOINed query » 2015-07-09 09:55:00

I have no idea. I looked my code and the mORMot unit but I found nothing

#30 Re: mORMot 1 » JOINed query » 2015-07-09 09:18:17

A compatiblity problem would be strange because it worked before my update

#31 Re: mORMot 1 » JOINed query » 2015-07-09 09:15:58

ab wrote:

How is your ITicketSignaling.ServerSetDB() method defined?

The error is pretty clear IMHO: the "wrapper" parameter of this method is not known.
Or perhaps even not compatible with interface-based services, which transmit values per representation, so need to be serializable as JSON.
See http://synopse.info/files/html/Synopse% … l#TITL_154

procedure TServiceSignaling.ServerSetDB(Wrapper: TACIASQLWrapper);
begin
  DB:=Wrapper.Rest;
  TSQLRestServerDB(DB).DB.LockingMode:=lmExclusive;
end;

#32 Re: mORMot 1 » JOINed query » 2015-07-09 09:01:06

I just updated my sources. I have a problem with this code :

STicket.GetRestServer.ServiceRegister(TServiceSignaling,[TypeInfo(ITicketSignaling)],sicShared);

http://www.noelshack.com/2015-28-143643 … -titre.png

#33 Re: mORMot 1 » JOINed query » 2015-07-09 07:04:49

ab wrote:

Try with the latest version of Mustache:

{{#if qte>1}}{{qte}}{{/if}}

See http://synopse.info/files/html/api-1.18 … ANDARDLIST

Ok, I don't have the latest version ! Thank you !

#34 Re: mORMot 1 » JOINed query » 2015-07-08 12:33:26

Hi,

I decided to use views with the ORM.

Now I have another question. Is possble to compare two values with a "IF" section in Mustache ??
(Example : {{#qte > 1}} {{qte}} {{/qte}} )

Thank you

#35 mORMot 1 » JOINed query » 2015-07-02 15:18:52

Thomas-Acia
Replies: 12

Hi,

I have to create a query between many tables in order to create a ticket (ticket like McDonald's for example). I must take a lot of informations in these tables. So I have to create joins. I read these parts of documentation : http://synopse.info/files/html/Synopse% … ml#TITL_70 and synopse.info/files/html/Synopse mORMot  … l#TITL_129 but I didn't understand all.

Firstly, for the cardinalities, I'll have a number of articles on my tickets, but this number may change every ticket. So I have to declare a number of attributs in my virtual table ? Like this  :

property FirstOne: TSQLMyFileInfo read FFirstOne write FFirstOne;
property SecondOne: TSQLMyFileInfo read FSecondOne write FSecondOne;

Or only one time ?

Secondly, the join must be created with the ID of the table I want to join or with the attribut ?

  MyFile := TSQLMyFile.CreateJoined(Client,aMyFileID); 

I didn't find a sample with an example of joins.

For now, I have this :

 { Table cat_passself }
  TSQLcat_passself = class(TSQLRecord)
  private
    fid_passage: Integer;
    fdate_passself, flibelle_repas, fnumero_ticket, foperateur, fprix_repas, fprix_repas_recalcul,
    fsubvention_fixe, fsubvention_cent : RawUTF8;
  published
    property id_passage: Integer Read fid_passage Write fid_passage;
    property date_passself: RawUTF8 Read fdate_passself Write fdate_passself;
    property libelle_repas: RawUTF8 Read flibelle_repas Write flibelle_repas;
    property numero_ticket: RawUTF8 Read fnumero_ticket Write fnumero_ticket;
    property operateur: RawUTF8 Read foperateur Write foperateur;
    property prix_repas: RawUTF8 Read fprix_repas Write fprix_repas;
    property prix_repas_recalcul: RawUTF8 Read fprix_repas_recalcul Write fprix_repas_recalcul;
    property subvention_fixe: RawUTF8 Read fsubvention_fixe Write fsubvention_fixe;
    property subvention_cent: RawUTF8 Read fsubvention_cent Write fsubvention_cent;
  end;

And in few tables :

   { Table com_personne }
  TSQLcom_personne = class(TSQLRecord)
  private
    fid_entite: Integer;
    fnom, fprenom1: RawUTF8;
    fcat_passself: TSQLcat_passself;
  published
    property id_entite: Integer Read fid_entite Write fid_entite;
    property nom: RawUTF8 Read fnom Write fnom;
    property prenom1: RawUTF8 Read fprenom1 Write fprenom1;
    property cat_passself: TSQLcat_passself read fcat_passself write fcat_passself;
  public
  end;

with the join with "cat_passself"

I only declared attributs in my virtual tables. I didn't create joins for now.


Thank you !

#36 Re: mORMot 1 » ZeosDB » 2015-05-29 14:48:21

By the way, my project is ended. I have a client and a server mORMot with a SQL query (ZEOS + PGSQL).

It's working on Linux AND Windows but not with an Android device yet. I'm working on it. If I have good news, I'll come back ! big_smile

#37 Re: mORMot 1 » ZeosDB » 2015-05-29 14:45:38

ab wrote:

ILIKE is not supported, since it is a PostgreSQL specific extension, not handled by Sqlite3 for instance.

Since ILIKE is not recognized by the framework, the statement is passed to the virtual SQLite3 table engine, which does not support ILIKE either...

IMHO the only possibility is to run the SQL query directly on PostgreSQL, using the SynDB connection properties.
ILIKE use falls into the category of optimization for a single SQL engine, so is not handled by the ORM.


Yes but the objective is to use the ORM anyway ..
So I use the Uppercase method.

And to return to the RDBMS "specificities", I think the caracters " . " or "UPPERCASE" are not just a specificitiy. It's a standard...

Thank you ! roll

#38 Re: mORMot 1 » ZeosDB » 2015-05-28 07:20:19

Hi,

How can I do a ILIKE pgsql with the ORM ? "Like" is working but not iLike

Thank's !

#39 Re: mORMot 1 » ZeosDB » 2015-05-21 15:25:52

And with uppercase too smile

#40 Re: mORMot 1 » ZeosDB » 2015-05-21 15:18:36

ab wrote:

A schema with . in it?

I just hate RDBMS specificities.
wink


Yes with . in it ! big_smile

#41 Re: mORMot 1 » ZeosDB » 2015-05-21 15:04:14

My connection is working well. But there's a problem in the framework.
When a schema contains a . in the name, mORMot doesn't generate the " " around the name.

#42 Re: mORMot 1 » ZeosDB » 2015-05-21 10:04:52

Hi,

I'm working on a new part of my projet. I just added RTTI to my server and now I'm trying to connect my server to PostgeSQL.

I used this

PropsPostgreSQL := TSQLDBZEOSConnectionProperties.Create(
   TSQLDBZEOSConnectionProperties.URI(dPostgreSQL,'localhost:5432'),
   'dbname','username','password');

And now my question is, how can I assign these properties ? Can I use a TZConnection or anything else ?

#43 Re: mORMot 1 » RTTI under FPC » 2015-05-19 19:48:44

RTTI is now working well. Next step is to connect my server to my Postgresql database with ZEOS.

#44 Re: mORMot 1 » RTTI under FPC » 2015-05-19 13:10:29

I found the problem.  TestSQL3FPCInterfaces was used in another unit !

Now a last error. Even if I include "My RTTI unit".pas, I have the "No RTTI available for ..."

#45 Re: mORMot 1 » RTTI under FPC » 2015-05-19 12:01:34

I have a new error, only with FPC :

1432036815-sans-titre.png

#46 Re: mORMot 1 » RTTI under FPC » 2015-05-19 08:01:11

ab wrote:

The wrapper generator need to access the FPC-mORMotInterfaces.pas.mustache template.

Ok all is now clear. Thank's a lot !

#47 Re: mORMot 1 » RTTI under FPC » 2015-05-19 07:58:51

ab wrote:

This should be the folder where the cross-platform templates files are available on your local computer.
It depends where you did unzip the framework source code.

Ok I corrected my links but what are they for ?

#48 Re: mORMot 1 » RTTI under FPC » 2015-05-19 07:08:32

What does

['..\CrossPlatform\templates','..\..\CrossPlatform\templates']

exactly mean ?

#49 Re: mORMot 1 » RTTI under FPC » 2015-05-19 07:07:09

AOG wrote:

If you like to experiment .... you could try this:

1)
Use fpcup to install the special branch of fpc, that includes an RTTI extension.
fpcup --fpcURL="rtti" --installdir="myspecialfpcdir"
https://github.com/LongDirtyAnimAlf/Reiniero-fpcup

2)
enable fpc RTTI inside of synopse.inc
{.$define HASINTERFACERTTI} ... remove dot

Note: this additional RTTI is (at the moment) only available for i386, X86_64 and ARM.

I already tried fpcup and I prefer CodeTyphon. But this is an other way to use RTTI, it's interesting.

#50 Re: mORMot 1 » RTTI under FPC » 2015-05-18 13:19:48

ab wrote:

Without the SQLite3ConsoleTests, of course: put here some code using your IIDAPSignaling interface with mORMot (or simply register it).

Yes of course big_smile

You have to run it under Delphi!
But Delphi 6 is enough - or any later revision.

With Delphi ok ! Thank you for the speed of your response

Board footer

Powered by FluxBB