A method for enhancing database management platform based on code injection
The method of code injection into the Archery platform simplifies and automates database management by adding callback events and using Gitlab updates, addressing slow updates and complex operations, enhancing user experience and adaptability.
Patent Information
- Application Number
- CN202110485985.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-30
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2041-04-30
AI Technical Summary
Current database management platforms face challenges such as slow updates, difficulty in customization due to lack of proficient R&D personnel, and complex operation steps, particularly with open-source software like Archery.
A method involving code injection into the Archery platform, using JavaScript and Gitlab, to enhance functionality by adding callback events, storing user preferences, and automatically updating code, with features like one-click database switching and SQL statement recording.
Simplifies operations, adapts to enterprise needs with real-time updates, reduces operation costs, and enhances user experience by automating common tasks and integrating permission applications.
Smart Images

Figure CN113254057B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of Internet technology, and in particular relates to a method for enhancing a database management platform based on code injection. Background Art
[0002] Currently, database management platforms used in the industry are primarily used for data querying, auditing, and executing SQL statements, as well as recording every database operation performed by enterprise R&D personnel. Open-source software, such as Archery, is often used to reduce development costs. Archery is developed in the Python programming language.
[0003] However, using open source software such as Archery has the following drawbacks: (1) Open source software updates slowly, often only taking several months to update, making it difficult to adapt to the needs of the enterprise. (2) The company lacks R&D personnel proficient in Python programming language, making it difficult to customize the database management platform according to the company's internal needs. (3) The database management platform is relatively simple in design, and R&D personnel have too many steps to use it. Summary of the Invention
[0004] The technical problem solved by the present invention is to provide a method for enhancing a database management platform based on code injection, which simplifies operation steps, automatically updates common functions in real time, and better meets usage requirements.
[0005] Technical solution: In order to solve the above technical problems, the technical solution adopted by the present invention is as follows:
[0006] A method for enhancing a database management platform based on code injection comprises: injecting code into the Archery database management platform; after the code is injected, adding a callback event to a function module, storing user operation options in a user body file, checking the user's local file at startup, and adding a button to select the most recently used function module on the page if a function module recently used by the user is found; and periodically detecting code changes to automatically update the user's injected code.
[0007] Preferably, code injection is implemented through JavaScript, and the functional modules include an instance selector, a database selector, a query quantity selector, and an SQL statement input box.
[0008] As a preferred method, after the code is injected, callback events will be added to the database instance selector, database selector, and query quantity selector. When the user confirms the selection, the selected item will be stored in the user's local file and the browser tab name will be changed.
[0009] As a preferred embodiment, after the code is injected, a callback event will be added to the SQL statement input box. When the user stops continuously entering statements, the entered statements will be saved to the user's local file.
[0010] Preferably, at startup, check the user's local files. If the recently selected database instance, selector, and query quantity are found, the corresponding data will be set on the page. At startup, check the user's local files. If the user has entered query data, the statement will be set to the SQL statement input box.
[0011] As a preference, add a "Apply for permissions on the currently selected database" button to the page at startup; when the user clicks the Apply Permissions button, a request body will be constructed and Archery's own Application Permissions interface will be called, so that convenient application permissions can be integrated into Archery's own ecosystem.
[0012] Preferably, the injected code is hosted by Gitlab, which checks the Gitlab code for changes at regular intervals while the browser is running. If changes are detected, the code that needs to be injected is updated locally.
[0013] Beneficial effects: Compared with the prior art, the present invention has the following advantages:
[0014] The method of enhancing the database management platform based on code injection of the present invention records commonly used databases, which is convenient for users to switch databases for query with one click; records the database used last time, which reduces the operation cost when users newly open the platform; applies for query permission of the current database or commonly used databases with one click, which reduces the operation cost when users apply for permission; records the SQL query statement entered last time, which effectively solves the problem of query data loss caused by R&D personnel accidentally closing or refreshing the web page; modifies the tab name of the web page when selecting or switching the database, which improves the selection cost of users when using the database management platform with multiple tabs; regularly detects GitLab code changes, realizes automatic update of the code injected by the user, solves the problem of slow update speed of open source software, is more adaptable to enterprise needs, simplifies the operation steps of operators, and improves usage efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 This is a flow chart of the present invention for enhancing the database management platform through code injection;
[0016] Figure 2 This is the functional diagram before enhancement according to the present invention;
[0017] Figure 3 This is the enhanced functional diagram of the present invention;
[0018] Figure 4 Automatic upgrade flow chart of the present invention. DETAILED DESCRIPTION
[0019] The present invention will be further illustrated below with reference to specific examples. The examples are implemented based on the technical solutions of the present invention. It should be understood that these examples are only used to illustrate the present invention and are not used to limit the scope of the present invention.
[0020] like Figure 1-4 As shown, a method for enhancing a database management platform based on code injection includes: injecting code into the Archery database management platform; after the code is injected, adding a callback event to the function module, storing the user operation options in the user body file, and checking the user's local file at startup. If the function module used by the user most recently is found, a button for selecting the most recently used function module will be added to the page; and code changes are detected regularly to realize automatic update of the user's injected code.
[0021] The code injection in this embodiment is implemented through JavaScript, or by developing a browser plug-in, which has more permissions. It can also be implemented by hijacking the script loaded by the web page. The advantage is that the client does not need any modification. The disadvantage is that it needs to be deployed to the server, which has certain operation and maintenance costs. The functional modules of the present invention include various functional modules such as instance selector, database selector, query quantity selector and SQL statement input box.
[0022] After the code is injected, callback events will be added to the database instance selector, database selector, and query quantity selector. When the user confirms the selection, the selected item will be stored in the user's local file and the browser tab name will be changed.
[0023] After the code is injected, a callback event will be added to the SQL statement input box. When the user stops continuously entering statements, the entered statements will be saved to the user's local file.
[0024] At startup, the user's local files are checked. If the recently selected database instance, selector, and query quantity are found, the corresponding data will be set on the page. At startup, the user's local files are checked. If the user has entered query data, the statement will be set to the SQL statement input box.
[0025] At startup, add a "Apply for permissions on the currently selected database" button to the page; when the user clicks the Apply Permissions button, a request body will be constructed and Archery's own permission application interface will be called, making the convenient permission application integrated into Archery's own ecosystem.
[0026] The injected code is hosted by Gitlab. When running in the browser, it will check whether the Gitlab code has changed at regular intervals. If changes are detected, the code that needs to be injected will be updated locally.
[0027] The present invention uses JavaScript and other languages to implement code injection; and uses Gitlab, an internal code hosting platform for enterprises, to improve the speed of Archery's iteration and launch. At the same time, the above technical means are used to enhance the following functions for the Archery database management platform: (1) record commonly used databases, so that users can switch databases for query with one click; (2) record the last used database, reducing the operation cost when users open the platform for the first time; (3) apply for query permissions for the current database or commonly used databases with one click, reducing the operation cost when users apply for permissions; (4) record the most recently entered SQL query statement, effectively solving the problem of query data loss caused by R&D personnel accidentally closing or refreshing the web page; (5) modify the tab name of the web page when selecting or switching databases, improving the selection cost of users when using the database management platform with multiple tabs. (6) regularly detect Gitlab code changes to achieve automatic update of user-injected code.
[0028] The above are only preferred embodiments of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for enhancing a database management platform based on code injection, characterized in that: include: Archery database management platform code injection; after code injection, add callback events to the function module, store user operation options in the user body file, check the user's local file at startup, and if the user's most recently used function module is found, add the most recently used function module selection button to the page; regularly detect code changes to achieve automatic update of the user's injected code; At startup, check the user's local files. If the recently selected database instance, selector, and query quantity are found, the corresponding data will be set on the page. At startup, check the user's local files. If the user has entered query data, the statement will be set to the SQL statement input box. At startup, add the "Apply for currently selected database permissions" button to the page; when the user clicks the Apply for permissions button, a request body will be constructed and Archery's own application permission interface will be called, so that the convenient application of permissions can be integrated into Archery's own ecosystem.
2. The method for enhancing the database management platform based on code injection according to claim 1, characterized in that: Code injection is implemented through JavaScript, and the functional modules include instance selector, database selector, query quantity selector and SQL statement input box.
3. The method for enhancing the database management platform based on code injection according to claim 2 is characterized in that: After the code is injected, callback events will be added to the database instance selector, database selector, and query quantity selector. When the user selects to confirm, the selected item will be stored in the user's local file and the browser tab name will be changed.
4. The method for enhancing the database management platform based on code injection according to claim 1, characterized in that: After the code is injected, a callback event will be added to the SQL statement input box. When the user stops inputting statements continuously, the entered statements will be saved to the user's local file.
5. The method for enhancing the database management platform based on code injection according to claim 1, characterized in that: The injected code is hosted by Gitlab, which will check whether the Gitlab code has changed at regular intervals when the browser is running. If changes are detected, the code that needs to be injected will be updated locally.
Citation Information
Patent Citations
Method and system for loading pages
CN102163206A
Navigation bar display method, device and system, and storage medium
CN108829309A
Code injection method and device, computer program product and storage medium
CN111124444A
Communication method and device for page end and native end, electronic equipment and readable medium
CN111722935A
Injection of Data Flow Control Objects into Application Processes
US20160342789A1
