Page 1 of 1

More DataTypeMapping woes

Posted: Fri 20 Oct 2017 02:48
by egrobler
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


Re: More DataTypeMapping woes

Posted: Fri 20 Oct 2017 13:29
by MaximG
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);

Re: More DataTypeMapping woes

Posted: Sat 21 Oct 2017 13:23
by egrobler
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

Re: More DataTypeMapping woes

Posted: Tue 24 Oct 2017 08:52
by MaximG
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

Re: More DataTypeMapping woes

Posted: Tue 24 Oct 2017 09:19
by egrobler
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

Re: More DataTypeMapping woes

Posted: Tue 24 Oct 2017 09:34
by MaximG
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.

Re: More DataTypeMapping woes

Posted: Thu 26 Oct 2017 11:16
by egrobler
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

Re: More DataTypeMapping woes

Posted: Thu 26 Oct 2017 12:33
by MaximG
Of course, for this, provide your license number via the e-support form ( https://www.devart.com the "Support"\"Request Support" menu)