Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the preliminary design of the syntax conversion tool for migrating to MySQL?

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article introduces the knowledge of "what is the preliminary design of the grammar conversion tool for migrating to MySQL". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Mode 1: specify database tables

The database, tables, fields and other metadata information is stored in the OPS metadata, and the dictionary information needs to be synchronized periodically with the online environment. After receiving the request from the front end, one-click conversion interface is provided. In this process, the following two steps are implemented:

1) construct the table-building statement on the SQL Server side, which can be used as a reference for the front-end display and conversion to MySQL syntax.

2) convert statements into SQL statements that conform to MySQL basic specifications, mainly involving data types, default values, storage engine, self-increment values, character sets and so on.

After the syntax conversion is completed, you can use the existing SQL audit service to further review the correction until it meets the criteria for automatic launch (for example, automatic launch can be achieved when the SQL score is above 80).

Mode 2: enter SQL text

There are currently two common problems with entering SQL text:

1) at present, the client tools used by the business side are different. The conversion of create table statements will generate two styles of table-building statements. The first type is create table xxxx, which has only one statement, and the second type is: create table xxxxx,alter table xxxx add xxx; will have multiple SQL statements.

2) in the process of converting input text to MySQL text, the complexity of parsing implementation is high because of the difference of front-end input information.

When executing the SQL text, the SQL is executed on the virtual database. After the execution is completed, the dictionary data on the SQL Servre side is synchronously pushed to the temporary metadata storage of the operation and maintenance system. On this basis, an one-click conversion interface is provided, and the following two steps are implemented in this process:

3) construct the table-building statement on the SQL Server side, which can be displayed at the front end and converted to MySQL syntax as a reference, and then the table-building statement will be integrated into a separate SQL.

4) convert the statement into SQL statement in accordance with the basic MySQL specification, mainly involving data type, default value, storage engine, self-increment value, character set and so on.

After the syntax conversion is completed, you can use the existing SQL audit service to further review the correction, but there is no docking SQL automation launch process.

Under the whole system, it is clear at a glance which interfaces need to be designed and which are internal and external services.

This is the end of the content of "what is the preliminary design of the grammar conversion tool for migrating to MySQL". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report