More DataTypeMapping woes

Discussion of open issues, suggestions and bugs regarding LiteDAC (SQLite Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
egrobler
Posts: 26
Joined: Mon 03 Dec 2012 14:35

More DataTypeMapping woes

Post by egrobler » Fri 20 Oct 2017 02:48

Hi Devart team,

As you explained you default to ftWideMemo when you cannot determine the type.
Is there a reason why ftWideString would not be a better default?

I have common code where the source database can either be mysql or SqlIte.
Any String function in LiteDac returns ftWideMemo which does not make sense to me.
This breaks some existing field assignment code at unexpected places since I moved the SQLite library to LiteDac.

I do not have the source code, would I be able to easily modify the mapping logic for my purpose if I upgrade to the source code version?

Code: Select all

create table test(
  name varchar(100)
);
insert into test(name) values ('john');
select name from test -- both MyDac/LiteDac returns ftWideString
MYDAC/MySQL
select  trim(name) from test  -- returns ftWideString
LITEDAC
select  trim(name) from test  -- returns ftWideMemo


MaximG
Devart Team
Posts: 1024
Joined: Mon 06 Jul 2015 11:34

Re: More DataTypeMapping woes

Post by MaximG » Fri 20 Oct 2017 13:29

In order for you to get the required field as ftWideString in LiteDAC, use DataTypeMapping : https://www.devart.com/litedac/docs/?da ... apping.htm
For example, for the query select trim(name) as myfield from test using rules for a particular field :

Code: Select all

….
UniQuery.DataTypeMap.AddFieldNameRule('myfield', ftWideString);

egrobler
Posts: 26
Joined: Mon 03 Dec 2012 14:35

Re: More DataTypeMapping woes

Post by egrobler » Sat 21 Oct 2017 13:23

Hi MaximG,

With respect, I do not think your solution is practical.
I do not want to add a AddFieldNameRule MANUALLY everytime I use a built-in SQLite string function like
lower, trim, replace, substr etc.

And can you please answer this question:
I do not have the source code, would I be able to easily modify the mapping logic for my purpose if I upgrade to the source code version?

Best Regards
Eric

MaximG
Devart Team
Posts: 1024
Joined: Mon 06 Jul 2015 11:34

Re: More DataTypeMapping woes

Post by MaximG » Tue 24 Oct 2017 08:52

We cannot change LiteDAC behavior in the way that interests you, since this change will affect all other users who use our product. However, you can make the necessary changes to the source code of LiteDAC after purchasing the corresponding version. We will indicate a place in the code and a way to implement this change

egrobler
Posts: 26
Joined: Mon 03 Dec 2012 14:35

Re: More DataTypeMapping woes

Post by egrobler » Tue 24 Oct 2017 09:19

Hi MaximG,

>We cannot change LiteDAC behavior in the way that interests you,
Ok, I understand.

How much will it cost me to upgrade to the source code version?
I recently purchased the base version.

Regards
Eric

MaximG
Devart Team
Posts: 1024
Joined: Mon 06 Jul 2015 11:34

Re: More DataTypeMapping woes

Post by MaximG » Tue 24 Oct 2017 09:34

You can get the required information and change the existing subscription at our website http://www.devart.com/litedac/ordering.html in the Subscription Renewals section the Renewals & Upgrades tab.

egrobler
Posts: 26
Joined: Mon 03 Dec 2012 14:35

Re: More DataTypeMapping woes

Post by egrobler » Thu 26 Oct 2017 11:16

Hi MaximG,

However, you can make the necessary changes to the source code of LiteDAC after purchasing the corresponding version. We will indicate a place in the code and a way to implement this change

Ok, I just upgraded to the source code version.
Can you please let me know where in the source code I can make the relevant changes.

Best Regards
Eric Grobler

MaximG
Devart Team
Posts: 1024
Joined: Mon 06 Jul 2015 11:34

Re: More DataTypeMapping woes

Post by MaximG » Thu 26 Oct 2017 12:33

Of course, for this, provide your license number via the e-support form ( https://www.devart.com the "Support"\"Request Support" menu)

Post Reply