#51 mORMot 1 » Firebird via Zeos no user table and unique fields » 2018-10-19 11:15:16

imperyal
Replies: 6

Hello, I'm starting with mORMot and now I'm trying to use a firebird database (Zeos). My AuthUser/AuthGroup tables are not being created, what's missing from that code below?

var
  fbDatabase: TSQLDBZEOSConnectionProperties;
begin
  Model  := CreateDataModel;

  fbDatabase := TSQLDBZEOSConnectionProperties.Create(
                TSQLDBZEOSConnectionProperties.URI(dFirebird, '', '.\Firebird\fbclient.dll', true),
                'fbDB.fdb',
                'sysdba',
                'masterkey');

  fbDatabase.ThreadingMode := tmMainConnection;

  VirtualTableExternalRegisterAll(Model, fbDatabase,[regMapAutoKeywordFields]);

  Server := TSQLRestServerDB.Create(Model, SQLITE_MEMORY_DATABASE_NAME, true);

  Server.CreateMissingTables;

  AddToServerWrapperMethod(Server, ['D:\Dev\mormot\CrossPlatform\templates']);

  HTTPServer := TSQLHttpServer.Create('8080', [Server], '+', useHttpApiRegisteringURI);
  HTTPServer.AccessControlAllowOrigin := '*';

One other difficulty I'm having with Firebird is that I can't index/unique my string fields (RawUTF8), I'm getting errors with the TSQLRecord below:

  TSQLClienteRecord = class(TSQLRecord)
  private
    fNome:  RawUTF8;
    fIdade: Int64;
    fNotas: RawUTF8;
  published
    property Nome:  RawUTF8 read fNome  write fNome stored AS_UNIQUE;
    property Idade: Int64   read fIdade write fIdade;
    property Notas: RawUTF8 read fNotas write fNotas;
  end;

These are some newbie questions I'm sure, sorry... And thank you smile

#52 Re: mORMot 1 » Smart Mobile Studio 3 - Compilation error » 2018-10-19 11:01:05

Nice, I will experiment with that today, thank you.

#53 Re: mORMot 1 » Smart Mobile Studio 3 - Compilation error » 2018-10-18 17:35:49

Maybe I'm not the right guy to help with this...

The mORMotClient.pas seems Ok.

The compilation errors are on the SynCrossPlatformSpecific.pas and SynCrossPlatformREST.pas.
System.Date seems to have been renamed to System.DateUtils?
The VarIsValidRef function does not exists anymore (or so it seems).
The decodeURIComponent function is now part of the class TString, TString.decodeURIComponent.

And finally, this function: function Add(Value: TSQLRecord; SendData: boolean; ForceID: boolean=false; const FieldNames: string=''): TID; virtual;
Is triggering: Syntax Error: const parameter cannot have a default value [line: 804, column: 46, file: SynCrossPlatformREST]

Is there a way to produce a js file to use on a VUE/REACT application? Put in another way, what is the best approach to build a client web app, other than using SMS?

I'm very new to this ORM and things, but I'm liking it so far.

#54 mORMot 1 » Smart Mobile Studio 3 - Compilation error » 2018-10-18 15:12:29

imperyal
Replies: 10

Hello! I'm evaluating mORMot and SMS 3 for a new project.

I tried the CopySynCrossPlatformUnits.bat file to copy the required .pas files to SMS but the locations appear to be wrong. I then copied the files manually to “C:\ProgramData\The Smart Company\Smart Mobile Studio\Libraries” and then SMS was able to find them.
When compiling the mORMotClient.pas file I get the following errors:
Syntax Error: Unit "System.Date" referenced in unit "SynCrossPlatformSpecific" not found [line: 100, column: 12, file: SynCrossPlatformSpecific]
Syntax Error: const parameter cannot have a default value [line: 804, column: 31, file: SynCrossPlatformREST]
Syntax Error: Unknown name "encodeURIComponent" [line: 1439, column: 13, file: SynCrossPlatformREST]

What am I doing wrong?

Thank you.

Board footer

Powered by FluxBB