SQLite uses a custom sintax for Trim Operator
Sqlite trim function [1] does not support the position argument but instead it uses the LTRIM and RTRIM functions for it.
This function is used for the product_cost_history module in order to compute the history data [2]
So in order to support this module on sqlite we must provide a mapping function for Trim on SQLITe which return the valid function depending on the position argument.
[1] https://www.sqlite.org/lang_corefunc.html#trim
[2] http://hg.tryton.org/modules/product_cost_history/file/6a2e94ade5b9/product.py#l46