Data Type Mapping, Domains & Charset

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
marcodor
Posts: 29
Joined: Tue 29 Oct 2013 20:30

Data Type Mapping, Domains & Charset

Post by marcodor » Sat 02 May 2015 16:22

Hello,

Will be very useful to have type mapping by db domains.
For example mapping boolean domain to TBooleanField
or unicode string domain to TWideStringField.

Also, please add Charset field to existing Size & Scale.
Or, if charset is UTF8 set field as TWideStringField automatically.

Current Options.BooleanDomainFields is per dataset setting, not per connection.
Is domain related to database (connection) or to a relation (dataset)?
Really funny.

Options.UseUnicode property should be "deprecated" as it sets ALL string fields to TWideStringField. You may have both kind of fields. Wrong way.

Thanks in advice!

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Data Type Mapping, Domains & Charset

Post by ViktorV » Tue 05 May 2015 12:30

1. If you want us to implement the features concerning data type mapping, please post a suggestion at our user voice forum:https://devart.uservoice.com/forums/104 ... e-firebird. If the suggestion gets a lot of votes, we will consider the possibility to implement it.
2. The BooleanDomainFields option belongs to dataset, since the field type is defined for each dataset, not for connection.
3. The TIBCConnection.Options.UseUnicode option is responsible for support for Unicode data in IBDAC in general, not just for TWideStringField fields creation. To create separate fields as TStringField, you can use Data Type Mapping.

marcodor
Posts: 29
Joined: Tue 29 Oct 2013 20:30

Re: Data Type Mapping, Domains & Charset

Post by marcodor » Tue 05 May 2015 13:47

ViktorV wrote:The BooleanDomainFields option belongs to dataset, since the field type is defined for each dataset
Right, field is defined per dataset.
But TYPE/DOMAIN of the field is a _database_ feature for all kind of DBMSes, so it should be per connection :)
ViktorV wrote:The TIBCConnection.Options.UseUnicode option is responsible for support for Unicode data in IBDAC in general
UseUnicode is related to strings (TWideStringField), not to any other type, beside general usage. I haven't seen yet unicode numbers, floats or datetime. And current (wrong) behavior handle _all_ strings field as unicode. DBMSes (and SQL standard) allow in the same database/table to have unicode & non-unicode fields at the same time.
ViktorV wrote:To create separate fields as TStringField, you can use Data Type Mapping.
That's why I asked to extend field mapping feature for domains/charset support. If project have about 100 tables/datasets (where many of them create fields dynamically) it's near impossible to define field mappings for each field name in particular. It's better to have one rule per connection (not dataset), for example all fields with UTF8 charset should be TWideStringField. Second, all fields with DM_BOOLEAN domain should be TBooleanField.

Thanks!

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Data Type Mapping, Domains & Charset

Post by ViktorV » Wed 06 May 2015 08:44

Thank you for your interest in our product.
We will consider the possibility to improve data type mapping in one of the next IBDAC versions.

marcodor
Posts: 29
Joined: Tue 29 Oct 2013 20:30

Re: Data Type Mapping, Domains & Charset

Post by marcodor » Wed 06 May 2015 11:56

Victor,

Thanks for taking in account this proposal! (without uservoice)
Hope to see it implemented as soon as possible :)
Have a nice day!

-
Dorin

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Data Type Mapping, Domains & Charset

Post by ViktorV » Wed 06 May 2015 12:18

Feel free to contact us if you have any further questions about IBDAC.

Post Reply