CYQ. Data lightweight Data layer V4.3 released [added support for SQLite and MySQL databases]

Source: Internet
Author: User

Preface:

Following the previous version: CYQ. Data lightweight Data layer V4.0 was released. It has been another month, but it has been a new year.

 

Because of the Chinese New Year's Eve, the framework has not had much to worry about, but years ago, we decided to support SQLite and MySQL databases.

 

Tip: based on the user's reminder, this version is released with CYQ. Data. xml, which adds a Chinese prompt for the method.

 

Next, let's take a look at the modification records of the new version.

1: MAction constructor allows loading from MDataRow

2: MutilLanguage also sets language IDs when setting cookies.

3: The default MutilLanguage language is taken from the browser language.

4: cancel the CYQ. Data. SQL. OutPutData class and two related enumeration tabletypes | DataBaseType, and move [generate enumeration | create paging storage process | create log table] and other operations to the auxiliary tool separately.

5: Cancel ProcedureSql and add SchemaAction to obtain table schema data.

6. Added support for SQLite data.

9: MAction adds anti-loading data from Json

7. Added support for MySql databases.

8: Improve the cache level of the data table architecture: MDataColumn-> MDataRow

 

 

The following is a detailed explanation.

 

I. MAction constructor allows loading from MDataRow

 

The reason for this increase is based on the data reuse issue in the autumn garden application. Let's briefly explain:

1: The autumn garden caches the user's information, that is, a row of data. OK. In fact, operations on all users come from the same table. Therefore, the data table structure can be retrieved from the cached Row for reverse filling.

Because the data table structure itself has a cache, the above filling effect is not obvious in a simple way.

2: when users edit their own data, they cannot perform operations on their own data rows. Therefore, filling in data can be quickly converted into operational MAction, saving a certain amount of cost.

 

2. MutilLanguage also sets language IDs when setting cookies.

3. The default MutilLanguage language is taken from the browser language.

 

In the autumn garden, multilingual applications are widely used, so there are many factors to consider, including the identification of the user's browser language to display different language articles, and through the suffix and non-suffix display, so small changes need to be made.

By the way, do not let go of the content in the CYQ. Data. Xml namespace.

 

Iv. Cancel the CYQ. Data. SQL. OutPutData class and two related enumeration tabletypes | DataBaseType, and move [generate enumeration | create paging storage process | create log table] and other operations to the auxiliary tool separately.
5. Cancel ProcedureSql and add SchemaAction to obtain table schema data.

 

These two adjustments mainly aim to reduce the size of the framework, while the internal class re-optimizes the structure without affecting the peripheral usage.

At the same time, removing the OutPutData class means that some auxiliary functions can only be implemented using auxiliary tools, including generating paging stored procedures for mssql/oracle.

 

6. Added support for SQLite data.

7. Added support for the MySql database.


Plug-in-type loading. If you need to use it, you only needMySql. Data. dllOrSystem. Data. SQLite. dllAnd CYQ. Data. dllPut them together.

Since SQLite and Access are both single article methods, the database link configuration method is similar to the following:

<Deleetask>
<Add key = "AccessDbNameForWeb" value = "App_Data/myspace. mdb"/>
<Add key = "SQLiteDbNameForWeb" value = "App_Data/sqlitedemo. db"/>
</AppSettings>
<ConnectionStrings>
<! -- <Add name = "Conn" connectionString = "Provider = Microsoft. Jet. OLEDB.4.0; Data Source = {0}" providerName = "System. Data. OleDb"/>
<Add name = "Conn" connectionString = "Data Source = {0}" providerName = "System. Data. SQLite"/> -->
<Add name = "Conn" connectionString = "server = localhost; port = 3309; user id = root; password = 123456; database = mysqldemo" providerName = "MySql. data. mySqlClient "/>

</ConnectionStrings>

 

8. Improve the cache level of the data table architecture: MDataColumn-> MDataRow

 

The table architecture cache has been upgraded to a certain level. Theoretically, the performance has been improved. This is a matter of internal optimization.

 

9: MAction increases data filling from Json anti-loading

 

The added function is for Ajax applications. The sample code of the application is as follows:

Using (MAction action = new MAction ("Blog_User "))
{
Action. GetFromJson ("{id: 2, name: \" \ ", url: \" www.cyqdata.com \"}");
Action. Update ();
}

The result is to change the name and url fields of the row data whose id is 2 to the corresponding data.

 

10. Download The V4.3 framework

 

: Download center-autumn Garden

PS: as a new database is added, the corresponding auxiliary tool V4.3 is also available for download. 

 

11. CYQ. Data framework project case

 

Web: http://www.cyqdata.com/cyqdata/article-cate-81

 

Welcome to continue providing CYQ. Data framework project cases.

 

Postscript:

Up to the current version, the supported database types are: Access/MSSQL [2000/2005/2008]/Oracle/SQLite/MySQL

The Access/MSSQL series have been applied in a large number of project applications, and are already quite stable.

For Oracle, the test is passed, and the existing middleware has been applied in the actual application project, waiting for the day when the project case is released.

For SQLite and MySQL, we have passed the test. If you encounter any problems in practical applications, please feel free to give feedback.

 

 

 

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.