CN116466932A - Database statement generation method and device, storage medium and electronic equipment - Google Patents

Database statement generation method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN116466932A
CN116466932A CN202310342293.0A CN202310342293A CN116466932A CN 116466932 A CN116466932 A CN 116466932A CN 202310342293 A CN202310342293 A CN 202310342293A CN 116466932 A CN116466932 A CN 116466932A
Authority
CN
China
Prior art keywords
target
database
display area
response
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310342293.0A
Other languages
Chinese (zh)
Inventor
陈定玮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Feisuanzhi Technology Shenzhen Co ltd
Original Assignee
Feisuanzhi Technology Shenzhen Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Feisuanzhi Technology Shenzhen Co ltd filed Critical Feisuanzhi Technology Shenzhen Co ltd
Priority to CN202310342293.0A priority Critical patent/CN116466932A/en
Publication of CN116466932A publication Critical patent/CN116466932A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/34Graphical or visual programming
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • G06F16/2433Query languages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/04842Selection of displayed objects or displayed text elements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/0486Drag-and-drop
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • G06F8/315Object-oriented languages
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Human Computer Interaction (AREA)
  • Databases & Information Systems (AREA)
  • Computing Systems (AREA)
  • Computational Linguistics (AREA)
  • Mathematical Physics (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The disclosure relates to a method and a device for generating database sentences, a storage medium and electronic equipment, and aims to solve the problems of high use threshold and low efficiency in the related technology of directly operating a database. The method comprises the following steps: responding to the operation of a user, displaying a database statement generation interface, wherein the database statement generation interface comprises a database display area, a table display area and an editing area; in response to dragging the target table identifier in the database display area to the table display area, table information of a target table corresponding to the target table identifier is displayed in the table display area; determining a target keyword corresponding to a keyword selection operation in response to the keyword selection operation in the editing area, and determining a target input parameter corresponding to a data operation in response to the data operation in the table display area for the table information; and generating a database statement according to the target keyword and the target input parameter.

Description

Database statement generation method and device, storage medium and electronic equipment
Technical Field
The disclosure relates to the technical field of databases, and in particular relates to a method and a device for generating database sentences, a storage medium and electronic equipment.
Background
SQL (Structured Query Language ) is mainly used in database systems, and is a general database query language standard that can be used to access data and query, update and manage relational database systems.
Currently, the SQL generation adopts a Client/server (Client/server) architecture to directly operate on the database, so as to assist technicians to generate SQL sentences executable in the database. However, the method requires a user to have professional SQL knowledge to generate the SQL sentence, has higher technical requirements on the user, has high development difficulty, and further causes a longer development period and lower efficiency.
Disclosure of Invention
The disclosure aims to provide a method and a device for generating database sentences, a storage medium and electronic equipment, so as to solve the problems of high use threshold and low efficiency in the related technology of directly operating a database.
To achieve the above object, a first aspect of the present disclosure provides a method for generating a database statement, the method including:
responding to the operation of a user, displaying a database statement generation interface, wherein the database statement generation interface comprises a database display area, a table display area and an editing area;
in response to dragging the target table identifier in the database display area to the table display area, table information of a target table corresponding to the target table identifier is displayed in the table display area;
determining a target keyword corresponding to a keyword selection operation in response to the keyword selection operation in the editing area, and determining a target input parameter corresponding to a data operation in response to the data operation in the table display area for the table information;
and generating a database statement according to the target keyword and the target input parameter.
Optionally, the determining, in response to the data operation for the table information in the table display area, a target input parameter corresponding to the data operation includes:
displaying a data description of target data in the table information in response to a first operation for the target data in the table display area;
determining a target input parameter corresponding to a data selection operation aiming at the target data in response to the data selection operation; or alternatively, the process may be performed,
displaying a third operation executable by the target data in response to a second operation for the target data in the table information in the table display area;
and in response to a selection operation for the third operation, determining a target input parameter corresponding to the selection operation.
Optionally, the method further comprises:
after the target input parameters corresponding to the data operation are determined, displaying the target input parameters in the editing area;
determining new target input parameters obtained through the editing operation in response to the editing operation of the target input parameters;
the generating a database statement according to the target keyword and the target input parameter includes:
and generating the database statement according to the target keyword and the new target input parameter.
Optionally, the method further comprises:
before the table display area displays the table information of the target table corresponding to the target table identifier in response to dragging the target table in the database display area to the table display area, determining a target database link in response to the configuration operation of the user on the database;
and displaying an identifier corresponding to the database information corresponding to the target database link in the database display area, wherein the database information comprises the target table.
Optionally, the method further comprises:
after the database statement is generated according to the target keyword and the target input parameter, an execution interface is displayed in response to an execution operation for the database statement, and a first sub-interface of the execution interface displays the database statement;
and acquiring an execution result of the database statement and displaying the execution result on a second sub-interface of the execution interface.
Optionally, the method further comprises:
responding to a save operation aiming at the database statement generation interface, and saving the current interface data of the database statement generation interface;
and responding to the operation of the user, displaying the database statement generation interface, and displaying the current interface data on the database statement generation interface.
Optionally, the table information of the target table includes at least one of a table name, a table annotation, a table engine, a column name, a column type, a column annotation, and an association relationship of the target table.
The second aspect of the present disclosure also provides a generating apparatus for a database statement, the apparatus including:
the display module is used for responding to the operation of a user and displaying a database statement generation interface, wherein the database statement generation interface comprises a database display area, a table display area and an editing area;
the dragging module is used for responding to dragging the target table identifier in the database display area to the table display area, and displaying table information of a target table corresponding to the target table identifier in the table display area;
a determining module, configured to determine, in response to a keyword selection operation for a keyword in the editing area, a target keyword corresponding to the keyword selection operation, and determine, in response to a data operation for the table information in the table display area, a target input parameter corresponding to the data operation;
and the generation module is used for generating a database statement according to the target keyword and the target input parameter.
A third aspect of the present disclosure also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method of any of the first aspects above.
A fourth aspect of the present disclosure also provides an electronic device, comprising:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to implement the steps of the method of any of the above first aspects.
According to the technical scheme, the database statement generation interface is displayed in response to operation of a user, wherein the database statement generation interface comprises a database display area, a table display area and an editing area, further, table information of a target table corresponding to the target table identification is displayed in the table display area in response to dragging of the target table identification in the database display area to the table display area, then, a target keyword corresponding to the keyword selection operation is determined in response to the keyword selection operation in the editing area, and target input parameters corresponding to the data operation are determined in response to data operation in the table display area, finally, the database statement is generated according to the target keyword and the target input parameters. By adopting the method, the table information of the target table is intuitively displayed through the table display area, and database sentences can be generated through operations such as dragging, selecting and the like, so that the editing operation of a user is simplified, the use threshold is reduced, and the development efficiency is improved.
Additional features and advantages of the present disclosure will be set forth in the detailed description which follows.
Drawings
The accompanying drawings are included to provide a further understanding of the disclosure, and are incorporated in and constitute a part of this specification, illustrate the disclosure and together with the description serve to explain, but do not limit the disclosure. In the drawings:
FIG. 1 is a flowchart illustrating a method of generating a database statement, according to an example embodiment;
FIG. 2 is a schematic diagram of a database statement generation interface, shown in accordance with an exemplary embodiment;
FIG. 3 is a schematic diagram of a database statement execution interface, shown in accordance with an exemplary embodiment;
FIG. 4 is a block diagram illustrating the generation of a database statement in accordance with an exemplary embodiment;
fig. 5 is a block diagram of an electronic device, according to an example embodiment.
Detailed Description
Specific embodiments of the present disclosure are described in detail below with reference to the accompanying drawings. It should be understood that the detailed description and specific examples, while indicating and illustrating the disclosure, are not intended to limit the disclosure.
It should be noted that, all actions for acquiring signals, information or data in the present disclosure are performed under the condition of conforming to the corresponding data protection rule policy of the country of the location and obtaining the authorization given by the owner of the corresponding device.
The term "including" and variations thereof as used herein are intended to be open-ended, i.e., including, but not limited to. The term "based on" is based at least in part on. The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments. Related definitions of other terms will be given in the description below.
It should be noted that the terms "first," "second," and the like in this disclosure are merely used to distinguish between different devices, modules, or units and are not used to limit the order or interdependence of functions performed by such devices, modules, or units.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those of ordinary skill in the art will appreciate that "one or more" is intended to be understood as "one or more" unless the context clearly indicates otherwise.
Fig. 1 is a flowchart illustrating a method of generating a database statement, as shown in fig. 1, according to an exemplary embodiment, the method including the following steps.
S101, responding to the operation of a user, and displaying a database statement generation interface.
The database statement generation interface includes a database display area, a table display area, and an editing area, as shown in fig. 2.
For example, the database presentation area may display database information of a plurality of databases, each database may include a plurality of tables, the table presentation area is used to present table information of a target table dragged into the table presentation area, the editing area may SELECT keywords, such as SELECT, FROM, WHERE, GROUP BY, ORDER BY, etc., specifically may be determined according to a type of database statement and database to be edited, for example DELETE of the statement, SELECT of the query statement, etc., and the database type includes a relational database such as mysql, tidb, hive, oracle, sqlserver, greenplum, dm, postgresql, gbase, which is not limited in this disclosure.
S102, in response to dragging the target table identifier in the database display area to the table display area, table information of the target table corresponding to the target table identifier is displayed in the table display area.
In a possible manner, the table information of the target table includes at least one of a table name, a table annotation, a table engine, a column name, a column type, a column annotation, and an association relationship of the target table.
Illustratively, as shown in fig. 2, table names (e.g., table 1), column names (e.g., a), column types (e.g., int), and associations between tables are shown, which are specifically determined according to requirements, and the present disclosure is not limited thereto. The association relationship may be a left association (left join), a right association (right join), an inner association (inlerjoin), a cartesian association (cross join), a full association (full outer join), a specific relationship name may be displayed, or different identifiers (such as different lines) may be used for distinguishing, which is not limited in this disclosure.
S103, determining a target keyword corresponding to the keyword selection operation in response to the keyword selection operation for the keyword in the editing area, and determining a target input parameter corresponding to the data operation in response to the data operation for the table information in the table display area.
Illustratively, as shown in FIG. 2, the target keyword "SELECT" is selected, along with the target input parameter "A".
S104, generating a database statement according to the target keywords and the target input parameters.
Illustratively, the target input parameter "A" is selected, for example, when the target keyword "SELECT" is selected. When the target keyword "FROM" is selected, the target input parameter "table 1" is selected, and the database sentence "select a FROM table 1" is generated (data with column name a is queried FROM table 1).
By adopting the method, the table information of the target table is intuitively displayed through the table display area, and database sentences can be generated through operations such as dragging, selecting and the like, so that the editing operation of a user is simplified, the use threshold is reduced, and the development efficiency is improved.
In a possible manner, the method further comprises: before table information of a target table corresponding to the target table identifier is displayed in the table display area in response to dragging the target table in the database display area to the table display area, determining a target database link in response to a configuration operation of a user on the database, and displaying an identifier corresponding to the database information corresponding to the target database link in the database display area, wherein the database information comprises the target table.
For example, a database configuration entry may be set in the database statement generation interface, for example, a configuration button is added, the configuration button is clicked to enter the database configuration interface, and the user may fill in information required for database configuration such as database links in the database configuration interface, and detailed description of the related art may be omitted herein. And then the target database is connected according to the filled information, so that the target database can be operated. Or a database configuration interface can be directly added, then an entry of a database statement generation interface is set on the database configuration interface, for example, a generation button is added, and the generation button is clicked to enter the database statement generation interface, so long as the configuration operation of the database can be satisfied.
In a possible manner, in response to a data operation for table information in the table display area, determining a target input parameter corresponding to the data operation may be: in response to a first operation in the table display area for target data in the table information, displaying a data description of the target data, in response to a data selection operation for the target data, determining a target input parameter corresponding to the data selection operation. Or, in response to a second operation on the target data in the table information in the table display area, displaying a third operation executable by the target data, and in response to a selection operation on the third operation, determining a target input parameter corresponding to the selection operation.
Illustratively, the first operation may be a click operation, a select operation, or the like to display a data description of the target data, such as clicking on "a" in table 1, or placing a mouse over "a", displaying column notes of a, which is not limiting to the present disclosure. The user can intuitively know the table information according to the information such as the column annotation and the like, and is convenient for the user to understand and select corresponding data, so that the target input parameters are determined. Correspondingly, the keywords of the editing module can also display corresponding description, so that the meaning and the usage of each keyword are convenient for a user to understand, and the use threshold of the user is reduced.
For example, the second operation may be a click operation, a right-click operation, or the like, such as a selection operation (third operation) of clicking first "a" in table 1 and then clicking "a" in table 2 to appear an association relationship, such as an inner association, a right association, or the like. And in particular may be set as desired, as this disclosure is not limited thereto. In addition, an operation instruction of the third operation can be displayed, so that the user can understand the usage of the third operation conveniently. Therefore, complex database sentences such as related sentences can be generated through simple selection operation, users do not need to have professional database knowledge, the use threshold of the users is reduced, and the development efficiency is improved.
In a possible manner, the method further comprises: after determining the target input parameters corresponding to the data operation, displaying the target input parameters in the editing area, and determining new target input parameters obtained through the editing operation in response to the editing operation on the target input parameters. The generation of the database statement from the target keyword and the target input parameter may be: and generating a database statement according to the target keyword and the new target input parameter.
Illustratively, the editing area may edit the target input parameters, refer to FIG. 2, e.g., delete or modify selected fields, or add fields, etc. It should be noted that, the target input parameter may be a field or a sentence, which is not limited in this disclosure, and specifically, reference may be made to a database sentence in the related art, which is not described herein.
In a possible manner, the method further comprises: after generating a database sentence according to the target keyword and the target input parameter, responding to an execution operation for the database sentence, displaying an execution interface, and displaying the database sentence by a first sub-interface of the execution interface; and acquiring an execution result of the database statement and displaying the execution result on a second sub-interface of the execution interface.
For example, the user may click on the "build" button in FIG. 2 to generate a database statement and enter into the execution interface, as shown in FIG. 3. The first sub-interface displays the database statement, the user can click "execute SQL", execute the generated database statement, and display the execution result on the second sub-interface.
In addition, clicking the "beautify SQL" button can simplify or normalize the database statement, so that the generated database statement is more concise and beautiful, and clicking the "generate SQL" can enter the database statement generation interface.
In a possible manner, the method further comprises: and storing current interface data of the database statement generation interface in response to a storage operation for the database statement generation interface, displaying the database statement generation interface in response to an operation of a user, and displaying the current interface data on the database statement generation interface.
For example, referring to fig. 2, the user may click a "save" button, save the current interface data, and automatically restore the current page data the next time the database statement generation interface is opened, or the user may select the history save data for restoration, which is not limited in this disclosure.
It should be noted that the interfaces in fig. 2 and 3 are only exemplary, and may be specifically set according to requirements, for example, a "preview" button is added to the database statement generation interface in fig. 2, and the generated database statement may be previewed by clicking the button. The present disclosure does not limit the implementation manner of the corresponding interface, as long as the above corresponding functions can be implemented. For example, an execution area may be provided in the interface of fig. 2 for displaying database statements and execution results, etc., which is not limited by the present disclosure.
Based on the same inventive concept, the embodiment of the present disclosure further provides a database statement generating apparatus, referring to fig. 4, the apparatus 400 includes:
the display module 401 is configured to display a database statement generation interface in response to an operation of a user, where the database statement generation interface includes a database display area, a table display area, and an editing area.
And a dragging module 402, configured to respond to dragging the target table identifier in the database display area to the table display area, and display table information of a target table corresponding to the target table identifier in the table display area.
A determining module 403, configured to determine, in response to a keyword selection operation for a keyword in the editing area, a target keyword corresponding to the keyword selection operation, and determine, in response to a data operation for the table information in the table display area, a target input parameter corresponding to the data operation.
And a generating module 404, configured to generate a database statement according to the target keyword and the target input parameter.
By adopting the device, the table information of the target table is intuitively displayed through the table display area, and database sentences can be generated through operations such as dragging, selecting and the like, so that the editing operation of a user is simplified, the use threshold is reduced, and the development efficiency is improved.
Optionally, the determining module 403 is configured to:
displaying a data description of target data in the table information in response to a first operation for the target data in the table display area;
determining a target input parameter corresponding to a data selection operation aiming at the target data in response to the data selection operation; or alternatively, the process may be performed,
displaying a third operation executable by the target data in response to a second operation for the target data in the table information in the table display area;
and in response to a selection operation for the third operation, determining a target input parameter corresponding to the selection operation.
Optionally, the apparatus 400 further comprises an editing module, the editing module being configured to:
after the target input parameters corresponding to the data operation are determined, displaying the target input parameters in the editing area;
determining new target input parameters obtained through the editing operation in response to the editing operation of the target input parameters;
the generating module 404 is configured to:
and generating the database statement according to the target keyword and the new target input parameter.
Optionally, the apparatus 400 further comprises a configuration module for:
before the table display area displays the table information of the target table corresponding to the target table identifier in response to dragging the target table in the database display area to the table display area, determining a target database link in response to the configuration operation of the user on the database;
and displaying an identifier corresponding to the database information corresponding to the target database link in the database display area, wherein the database information comprises the target table.
Optionally, the apparatus 400 further includes an execution module, where the execution module is configured to:
after the database statement is generated according to the target keyword and the target input parameter, an execution interface is displayed in response to an execution operation for the database statement, and a first sub-interface of the execution interface displays the database statement;
and acquiring an execution result of the database statement and displaying the execution result on a second sub-interface of the execution interface.
Optionally, the apparatus 400 further comprises a saving module, where the saving module is configured to:
responding to a save operation aiming at the database statement generation interface, and saving the current interface data of the database statement generation interface;
and responding to the operation of the user, displaying the database statement generation interface, and displaying the current interface data on the database statement generation interface.
Optionally, the table information of the target table includes at least one of a table name, a table annotation, a table engine, a column name, a column type, a column annotation, and an association relationship of the target table.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
Based on the same inventive concept, the embodiments of the present disclosure further provide a non-transitory computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method for generating a database statement as described in any of the above.
Based on the same inventive concept, the embodiments of the present disclosure further provide an electronic device, including:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to implement the steps of the method for generating a database statement as described in any one of the above.
Fig. 5 is a block diagram of an electronic device 500, according to an example embodiment. Referring to fig. 5, an electronic device 500 includes a processor 501, which may be one or more in number, and a memory 502 for storing a computer program executable by the processor 501. The computer program stored in memory 502 may include one or more modules each corresponding to a set of instructions. Further, the processor 501 may be configured to execute the computer program to perform the above-described database statement generation method.
In addition, the electronic device 500 may further include a power supply component 505 and a communication component 503, the power supply component 505 may be configured to perform power management of the electronic device 500, and the communication component 503 may be configured to enable communication of the electronic device 500, e.g., wired or wireless communication. In addition, the electronic device 500 may also include an input/output (I/O) interface 504. The electronic device 500 may operate an operating system, such as Windows Server, based on data stored in the memory 502 TM ,Mac OS X TM ,Unix TM ,Linux TM Etc.
In another exemplary embodiment, a computer readable storage medium is also provided, comprising program instructions which, when executed by a processor, implement the steps of the method of generating a database statement as described above. For example, the non-transitory computer readable storage medium may be the memory 502 including program instructions described above that are executable by the processor 501 of the electronic device 500 to perform the method of generating database statements described above.
In another exemplary embodiment, a computer program product is also provided, comprising a computer program executable by a programmable apparatus, the computer program having code portions for performing the above-described method of generating database statements when executed by the programmable apparatus.
The preferred embodiments of the present disclosure have been described in detail above with reference to the accompanying drawings, but the present disclosure is not limited to the specific details of the above embodiments, and various simple modifications may be made to the technical solutions of the present disclosure within the scope of the technical concept of the present disclosure, and all the simple modifications belong to the protection scope of the present disclosure.
In addition, the specific features described in the foregoing embodiments may be combined in any suitable manner, and in order to avoid unnecessary repetition, the present disclosure does not further describe various possible combinations.
Moreover, any combination between the various embodiments of the present disclosure is possible as long as it does not depart from the spirit of the present disclosure, which should also be construed as the disclosure of the present disclosure.

Claims (10)

1. A method for generating database statements, the method comprising:
responding to the operation of a user, displaying a database statement generation interface, wherein the database statement generation interface comprises a database display area, a table display area and an editing area;
in response to dragging the target table identifier in the database display area to the table display area, table information of a target table corresponding to the target table identifier is displayed in the table display area;
determining a target keyword corresponding to a keyword selection operation in response to the keyword selection operation in the editing area, and determining a target input parameter corresponding to a data operation in response to the data operation in the table display area for the table information;
and generating a database statement according to the target keyword and the target input parameter.
2. The method of claim 1, wherein the determining, in response to a data operation for the table information in the table presentation area, a target input parameter corresponding to the data operation comprises:
displaying a data description of target data in the table information in response to a first operation for the target data in the table display area;
determining a target input parameter corresponding to a data selection operation aiming at the target data in response to the data selection operation; or alternatively, the process may be performed,
displaying a third operation executable by the target data in response to a second operation for the target data in the table information in the table display area;
and in response to a selection operation for the third operation, determining a target input parameter corresponding to the selection operation.
3. The method according to claim 1, wherein the method further comprises:
after the target input parameters corresponding to the data operation are determined, displaying the target input parameters in the editing area;
determining new target input parameters obtained through the editing operation in response to the editing operation of the target input parameters;
the generating a database statement according to the target keyword and the target input parameter includes:
and generating the database statement according to the target keyword and the new target input parameter.
4. A method according to any one of claims 1-3, wherein the method further comprises:
before the table display area displays the table information of the target table corresponding to the target table identifier in response to dragging the target table in the database display area to the table display area, determining a target database link in response to the configuration operation of the user on the database;
and displaying an identifier corresponding to the database information corresponding to the target database link in the database display area, wherein the database information comprises the target table.
5. A method according to any one of claims 1-3, wherein the method further comprises:
after the database statement is generated according to the target keyword and the target input parameter, an execution interface is displayed in response to an execution operation for the database statement, and a first sub-interface of the execution interface displays the database statement;
and acquiring an execution result of the database statement and displaying the execution result on a second sub-interface of the execution interface.
6. A method according to any one of claims 1-3, wherein the method further comprises:
responding to a save operation aiming at the database statement generation interface, and saving the current interface data of the database statement generation interface;
and responding to the operation of the user, displaying the database statement generation interface, and displaying the current interface data on the database statement generation interface.
7. A method according to any of claims 1-3, wherein the table information of the target table comprises at least one of a table name, a table annotation, a table engine, a column name, a column type, a column annotation and an association relationship of the target table.
8. A database statement generation apparatus, the apparatus comprising:
the display module is used for responding to the operation of a user and displaying a database statement generation interface, wherein the database statement generation interface comprises a database display area, a table display area and an editing area;
the dragging module is used for responding to dragging the target table identifier in the database display area to the table display area, and displaying table information of a target table corresponding to the target table identifier in the table display area;
a determining module, configured to determine, in response to a keyword selection operation for a keyword in the editing area, a target keyword corresponding to the keyword selection operation, and determine, in response to a data operation for the table information in the table display area, a target input parameter corresponding to the data operation;
and the generation module is used for generating a database statement according to the target keyword and the target input parameter.
9. A non-transitory computer readable storage medium having stored thereon a computer program, characterized in that the program when executed by a processor realizes the steps of the method according to any of claims 1-7.
10. An electronic device, comprising:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to implement the steps of the method of any one of claims 1-7.
CN202310342293.0A 2023-03-27 2023-03-27 Database statement generation method and device, storage medium and electronic equipment Pending CN116466932A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310342293.0A CN116466932A (en) 2023-03-27 2023-03-27 Database statement generation method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310342293.0A CN116466932A (en) 2023-03-27 2023-03-27 Database statement generation method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN116466932A true CN116466932A (en) 2023-07-21

Family

ID=87181673

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310342293.0A Pending CN116466932A (en) 2023-03-27 2023-03-27 Database statement generation method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN116466932A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109446218A (en) * 2018-09-25 2019-03-08 中国平安人寿保险股份有限公司 SQL statement generation method, device and computer readable storage medium
CN109992589A (en) * 2019-04-11 2019-07-09 北京启迪区块链科技发展有限公司 Method, apparatus, server and the medium of SQL statement are generated based on visual page
US20220121631A1 (en) * 2020-10-15 2022-04-21 Google Llc Automatic generation of a data model from a structured query language (sql) statement
CN115576974A (en) * 2022-09-30 2023-01-06 中电金信软件有限公司 Data processing method, device, equipment and medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109446218A (en) * 2018-09-25 2019-03-08 中国平安人寿保险股份有限公司 SQL statement generation method, device and computer readable storage medium
CN109992589A (en) * 2019-04-11 2019-07-09 北京启迪区块链科技发展有限公司 Method, apparatus, server and the medium of SQL statement are generated based on visual page
US20220121631A1 (en) * 2020-10-15 2022-04-21 Google Llc Automatic generation of a data model from a structured query language (sql) statement
CN115576974A (en) * 2022-09-30 2023-01-06 中电金信软件有限公司 Data processing method, device, equipment and medium

Similar Documents

Publication Publication Date Title
CN110704398B (en) Database migration method and device from MySQL to Oracle and computer equipment
CN112650766B (en) Database data operation method, system and server
CN109145047B (en) User tag portrait configuration method, data processing device and storage medium
CN109710631A (en) Auxiliary generates method, apparatus, equipment and the computer storage medium of SQL code
CN111124379B (en) Page generation method and device, electronic equipment and storage medium
CN111427901A (en) Interactive knowledge graph data editing method, computer device and storage medium
CN112199007A (en) Menu display method and device, electronic equipment and storage medium
CN109376153A (en) System and method for writing data into graph database based on NiFi
US20230048310A1 (en) System and method for identifying members of a dynamic target segment
CN115576974A (en) Data processing method, device, equipment and medium
CN111177247A (en) Data conversion method, device and storage medium
CN109033157B (en) Complex data retrieval method and system based on user-defined search condition tree
CN112686580A (en) Workflow definition method and system capable of customizing flow
CN111782820A (en) Knowledge graph creating method and device, readable storage medium and electronic equipment
CN116466932A (en) Database statement generation method and device, storage medium and electronic equipment
CN116467433A (en) Knowledge graph visualization method, device, equipment and medium for multi-source data
CN110716911B (en) Data processing method and device, electronic equipment and storage medium
CN113495723B (en) Method, device and storage medium for calling functional component
CN114297443B (en) Processing method, device, equipment and storage medium of graph data query statement
CN115525321A (en) Distributed task generation method, device, equipment and storage medium
CN115455477A (en) Data authority management method, device, equipment, medium and program product
CN114153438A (en) API automatic generation system
CN114036178A (en) Service interface generation method, device, computer and readable storage medium
KR20130056065A (en) Apparatus and method for defining query for multi-tenant
CN108228161B (en) System and method for extending structured command line

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination