#1 2020-01-21 17:42:57

RaelB
Member
Registered: 2010-08-04
Posts: 57

Custom field names

Hello,

Does mORMot allow to customize field names?

e.g.

TPerson
...
published
  FirstName: RawUTF8;
  LastName: RawUTF8;
...

In database to be represented as
  first_name, last_name

Thanks
Rael

Offline

#2 2020-01-21 21:51:30

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,706
Website

Re: Custom field names

Yes, it is called field mapping.

See for instance https://synopse.info/files/html/Synopse … #MNDX_1339

Offline

#3 2020-01-22 04:06:04

RaelB
Member
Registered: 2010-08-04
Posts: 57

Re: Custom field names

Thanks.

There is a small typo there:

VirtualTableExternalRegister(fExternalModel,TSQLRecordPeopleExt,fProperties,'PeopleExternal');

We also customized the name of the external table, from its default 'PeopleExt' (computed by /timing/ TSQLRecord prefix from TSQLRecordPeopleExt) into 'PeopleExternal'.

Should be "trimming"

Offline

Board footer

Powered by FluxBB