#1 2019-09-06 13:41:30

mrsw
Member
Registered: 2019-09-06
Posts: 6

Firebird and Dialect 3 quoted field names

Hi,
I'm evaluating the mORMot framework for a new project of mine.
I use firebird as database server for many years and I would use it with the mORMot framework, but I encountered a problem. I ever used dialect 3 on firebird and double quoted field names.
I adapted the 04 - HTTP Client-Server sample to access a firebird database but CreateMissingTables fails because the field named Time is in conflict with firebird time field type. I don't find a place where instruct the framework to produce sql statements with field names enclosed in double quotes.
How could it be achieved?
Thanks in advance

Carlo

Offline

#2 2019-09-06 16:15:47

mrsw
Member
Registered: 2019-09-06
Posts: 6

Re: Firebird and Dialect 3 quoted field names

I managed to get around the problem mapping the time field to "Time".
Tabe was successfully created.
This is the code

Model.Props[TSQLSampleRecord].ExternalDB.MapField('Time', '"Time"');

Is this the only available way to do this or I can define a flag in the framework to tell it to quote field names?
Thanks.

  Carlo

Offline

#3 2019-09-09 11:10:22

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

Re: Firebird and Dialect 3 quoted field names

Those dialects are quite a mess...

I tried to implement rpmQuoteFieldName new mapping option, which does the MapField() call for all fields.
See https://synopse.info/fossil/info/582c350655
Feedback is welcome! Especially I am not sure if it works fully with the ID field...

Offline

#4 2019-09-13 14:37:32

mrsw
Member
Registered: 2019-09-06
Posts: 6

Re: Firebird and Dialect 3 quoted field names

ab wrote:

Those dialects are quite a mess...

I tried to implement rpmQuoteFieldName new mapping option, which does the MapField() call for all fields.
See https://synopse.info/fossil/info/582c350655
Feedback is welcome! Especially I am not sure if it works fully with the ID field...

Thanks ab,
I'll try it.

In the mean time I do other tests with the framework: new problem! The first time the server is started and CreateMissingTables is called, all goes fine, the table is created, but next time the server starts it tries to update the table adding an index that already exists. Why? Where I'm wrong?

Offline

#5 2019-09-13 15:28:13

mrsw
Member
Registered: 2019-09-06
Posts: 6

Re: Firebird and Dialect 3 quoted field names

I also noticed on the same Sample project, after applyed quoted field names option on the server side, an error (field not found) is raised when on the client side is made a search of a previously inserted message.
Field names are not quoted on building the sql statement!

Offline

Board footer

Powered by FluxBB