Nbearlite's Bug in accessing PostgreSql, MySql, and Sqlite

Source: Internet
Author: User

It turns out that the author has been using nbearlite in MSSQL, but recently I want to use it in MySQL and found a bug, mainly caused by the parameterization process. We all know that in the MSSQL database, all parameters are represented by @ ID, but are used in MySQL? Id representation (PostgreSQL and SQLite will also have the same problem). It turns out that nbearlite becomes? @ ID, so I modified the code.

The addexpressionparameters method of the sqlqueryfactory class is modified.
P. parametername = paramprefixtoken + en. Current. Key. trimstart (paramprefixtoken );
Changed:
If (paramprefixtoken! = '@')
{
P. parametername = en. Current. Key. Replace ("@", paramprefixtoken. tostring ());
}
Else
{
P. ParameterName = en. Current. Key;
}

 

That is, the problem is solved. This change also solves the problem of PostgreSql and Sqlite. This record is specially made to facilitate the use of Nbearlite to solve this problem smoothly.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.