WO2018103223A1 - 一种操作数据库的方法及装置 - Google Patents

一种操作数据库的方法及装置 Download PDF

Info

Publication number
WO2018103223A1
WO2018103223A1 PCT/CN2017/076038 CN2017076038W WO2018103223A1 WO 2018103223 A1 WO2018103223 A1 WO 2018103223A1 CN 2017076038 W CN2017076038 W CN 2017076038W WO 2018103223 A1 WO2018103223 A1 WO 2018103223A1
Authority
WO
WIPO (PCT)
Prior art keywords
database
text content
user
target text
content
Prior art date
Application number
PCT/CN2017/076038
Other languages
English (en)
French (fr)
Inventor
张利平
Original Assignee
武汉斗鱼网络科技有限公司
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 武汉斗鱼网络科技有限公司 filed Critical 武汉斗鱼网络科技有限公司
Publication of WO2018103223A1 publication Critical patent/WO2018103223A1/zh

Links

Images

Classifications

    • 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
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • G06F8/311Functional or applicative languages; Rewrite languages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files

Definitions

  • the present invention relates to the field of computer program development technologies, and more particularly to a method and apparatus for operating a database.
  • the existing method of operating the database is mainly for the technician to first create a database client instance and manually type the database command in the database client instance to execute the database command through the database client instance.
  • the purpose of the present application is to provide a method and an apparatus for operating a database, which can improve the problem that the database operation is inconvenient and the execution efficiency of the database command is low during the operation of the existing database.
  • an embodiment of the present application provides a method for operating a database, including:
  • the displayed text content includes at least a database command line
  • the returned result is displayed in the output window.
  • the acquiring the target text content to be executed by the user includes:
  • the target text content to be executed by the user is obtained according to the text selection range corresponding to the selected instruction.
  • the method before the sending the database command line to the database server according to the target text content, the method further includes:
  • obtaining a preset connection address in the text content including:
  • the character string following the first preset character in the content of the line is obtained, and the character string is used as the preset connection address.
  • the sending according to the target text content, a database command line to the database server, including:
  • a database command and parameters are sent to the database server based on the database command line set.
  • the return result is displayed in the output window by calling a display method of the output window instance.
  • the preset text editor is a VS Code
  • the database server is a Redis server
  • the acquiring target text content to be executed by the user includes:
  • the vscode.window.activeTextEditor.document.getText method is called to obtain the text content, and the text content is used as the target text content to be executed by the user.
  • an embodiment of the present application further provides an apparatus for operating a database, including:
  • a first obtaining module configured to acquire, according to the displayed text content, a target text content to be executed by the user when detecting that the extension program is started, and the displayed text content includes at least a database command line;
  • a sending module configured to send a database command line to the database server according to the content of the target text
  • a second obtaining module configured to obtain a return result of the database server
  • a display module for displaying the returned results in the output window.
  • the device further includes:
  • a detecting module configured to detect a user opening instruction for a text file
  • the second display module is configured to display the text content in the target text file opened by the user by using a preset text editor when the open command is detected.
  • the device further includes:
  • the startup module is configured to start the expansion program when detecting an input instruction of the preset shortcut key by the user; or, when the user selects the selected instruction of the preset option in the right-click menu, start the expansion program.
  • the first obtaining module includes:
  • a detecting unit configured to detect a user's selected instruction for the text content
  • the first obtaining unit is configured to acquire the target text content to be executed by the user according to the text selection range corresponding to the selected instruction when the selected instruction is detected.
  • the first obtaining module further includes:
  • a second acquiring unit configured to acquire the text content when the selected instruction is not detected, and use the text content as the target text content to be executed by the user.
  • the device further includes:
  • a connection module for connecting to a database server through a database client instance.
  • connection module includes:
  • a third obtaining unit configured to acquire a preset connection address in the text content
  • connection unit is configured to connect to the database server corresponding to the preset connection address through the database client instance.
  • the third obtaining unit is configured to detect each line of content in the text content; when the first preset character is detected in any line of content, obtain a string after the first preset character in any line of content , the string is used as the default connection address.
  • the third obtaining unit is configured to notify the user that the database server cannot be connected when the first preset character is not detected in each line of content or the first preset character is followed by an empty character string.
  • the sending module includes:
  • the sending unit is configured to send a database command and a parameter to the database server based on the database command line set.
  • the first display module includes:
  • the writing unit is configured to obtain a data type of the returned result; when the data type of the returned result is a number, the data type corresponding to the returned number and the returned number are written to the output window; when the data type of the returned result is When the string is a string, the returned string is written to the output window; when the data type of the returned result is an empty object, the preset keyword is written to the output window; when the data type of the returned result is an object, the returned object is converted. Writes the converted string to the output window as a string.
  • the first obtaining module is configured to invoke
  • the vscode.window.activeTextEditor.selection.isEmpty interface detects whether the user selects the text content. Based on the value returned by the interface, when the user selects the text content, the vscode.window.activeTextEditor.selection is used as the parameter, and the vscode is called.
  • the .window.activeTextEditor.document.getText method gets the target text content to be executed by the user; when it detects that the user has not selected the text content, it calls the vscode.window.activeTextEditor.document.getText method to obtain the text content and the text content. As the target text content to be executed by the user.
  • an embodiment of the present application further provides an apparatus for operating a database, including:
  • At least one processor At least one processor
  • At least one memory communicatively coupled to the processor, wherein:
  • the memory stores program instructions executable by the processor, the processor invoking the program instructions to perform the following methods:
  • the displayed text content includes at least a database command line
  • the returned result is displayed in the output window.
  • an embodiment of the present application further provides a computer program, including program code, where the program code is configured to perform the following operations:
  • the processor is configured to invoke logic instructions in the memory to perform the following methods:
  • the displayed text content includes at least a database command line
  • the returned result is displayed in the output window.
  • an embodiment of the present application further provides a storage medium for storing a computer program as described above.
  • a method for operating a database obtained by an embodiment of the present application obtains a target text content to be executed by a user when detecting that the extension program is started based on the displayed text content.
  • the returned result is displayed in the output window. Since the corresponding database command can be executed according to the text content displayed in the opened text file based on the startup extension program, the database command is not copied or manually typed, thereby saving the command input time when the database command is executed, thereby improving the time. The efficiency of database command execution.
  • the database command can be split into multiple text files, and the corresponding database commands are respectively executed by opening multiple text files. Therefore, it is convenient for the user to manage the execution flow of the database command.
  • FIG. 1 is a flow chart showing the steps of a method for operating a database according to an embodiment of the present invention
  • FIG. 2 is a schematic flow chart showing the steps of a method for operating a database according to another embodiment of the present invention.
  • FIG. 3 is a schematic diagram showing display of text content in an embodiment of the present invention.
  • FIG. 4 is a schematic diagram showing display of a database command execution result according to an embodiment of the present invention.
  • FIG. 6 is a structural block diagram of an apparatus for operating a database according to an embodiment of the present invention.
  • the existing method of operating the database is mainly to first create a database client instance through the database software, and manually type the database command in the database client instance. Alternatively, copy a database command to the database client instance. Because both of the above methods require manual creation of a database client instance, and whether it is manually typed or copied database commands takes a long time and is prone to errors, resulting in no operation on the database. Too convenient, database commands are less efficient to execute.
  • the embodiments of the present invention provide a method for operating a database.
  • a method for operating a database provided by this embodiment and subsequent embodiments is applicable to a terminal for installing any type of operating system.
  • the applicable operating system may be a Windows operating system, a Linux operating system, or an OS X operating system, which is not specifically limited in this embodiment.
  • the method provided by the embodiment of the present invention acquires the target text content to be executed by the user when detecting that the extension program is started based on the displayed text content.
  • the returned result is displayed in the output window. Since the corresponding database command can be executed according to the text content displayed in the opened text file based on the startup extension program, the database command is not copied or manually typed, thereby saving the command input time when the database command is executed, thereby improving the time. The efficiency of database command execution.
  • the database command can be split into multiple text files, and the corresponding database commands are respectively executed by opening multiple text files. Therefore, it is convenient for the user to manage the execution flow of the database command.
  • the text content in the target text file opened by the user is displayed by a preset text editor.
  • the preset text editor may be an open source text editor used for program development, such as Visual Studio Code (referred to as VS Code), Sublime Text, Atom, VIM or Notepad++, etc. This embodiment and subsequent embodiments do not specifically limited.
  • the extension program is started.
  • obtaining the target text content to be executed by the user includes:
  • the target text content to be executed by the user is obtained according to the text selection range corresponding to the selected instruction.
  • the method further includes:
  • the text content is obtained and the text content is taken as the target text content to be executed by the user.
  • the method before sending the database command line to the database server according to the target text content, the method further includes:
  • connecting to the database server through a database client instance including:
  • obtaining a preset connection address in the text content includes:
  • the character string following the first preset character in any line of content is obtained, and the character string is used as the preset connection address.
  • the method includes:
  • the database command line is sent to the database server according to the target text content, including:
  • the database command line is sent to the database server based on the database command line set, including:
  • any database command line in the database command line set when it is detected that any database command line is not empty and does not contain the first preset character, the database command and parameters corresponding to any database command line are obtained.
  • the returned results are displayed in the output window, including:
  • the return result is displayed in the output window by calling the display method of the output window instance.
  • writing the returned results to the output window includes:
  • the data type of the returned result is a number
  • the data type corresponding to the returned number and the returned number are written to the output window
  • the returned string is written to the output window
  • the preset keyword is written to the output window
  • the returned object is converted to a string, and the converted string is written to the output window.
  • the preset text editor is VS Code
  • the database server is a Redis server
  • the target text content to be executed by the user is obtained, including:
  • the vscode.window.activeTextEditor.selection As a parameter, the vscode.window.activeTextEditor.document.getText method is called to obtain the target text content to be executed by the user;
  • the method of vscode.window.activeTextEditor.document.getText is called to obtain the text content, and the text content is used as the target text content to be executed by the user.
  • the embodiment of the present invention provides a more specific method for operating a database.
  • the embodiment uses a preset text editor as the VS Code and a database as the Redis as an example to describe the process of the database command execution method.
  • VS Code is an open source text editor developed by Microsoft and supports both Windows, Linux and OS x operating systems.
  • VS Code supports extensions and built-in extension management functions.
  • Redis is an open source, network-enabled, memory-based key-value pair storage database.
  • the method flow provided by this embodiment includes: 201: detecting an open instruction of a user to a text file; 202, displaying, when the open command is detected, displaying, by using VS Code, text content in a target text file opened by the user; Based on the displayed text content, when detected When the expansion program starts, acquiring the target text content to be executed by the user; 204, sending a database command line to the Redis server according to the target text content; 205, obtaining a return result of the Redis server; 206, displaying the return result in the output window of the VS Code .
  • the database command in the execution text file is implemented, so that the user (ie, the relevant program developer) can pre-edit the inclusion according to actual needs before executing this step.
  • the text file of the database command line is not specifically limited in this embodiment. Among them, the user can edit multiple text files containing the database command line and store them in the preset directory according to the actual program development requirements.
  • the user's open command to the text file can be detected.
  • the user can select a text file containing the database command line in the preset directory, and open the text file through VS Code, that is, input an open command.
  • This step is mainly a process of opening a text file through VS Code, and the opened text file can be used as a target text file.
  • the content of the text in the target text file may include the database command line, the address of the Redis server, and the connection port.
  • the content of the target text file is not specifically limited in this embodiment.
  • the subsequent steps of this step are mainly to use the open text file as the target text file, and implement the process of executing the database command based on the target text file.
  • the text editor usually supports opening a plurality of text files at the same time, the user can open a plurality of other text files according to this step and the above-mentioned step 201 before the target text file is opened.
  • This embodiment does not specifically limit this.
  • the user can operate the target text file to perform the database command to implement the database command, so as to implement the database command, which is not specifically limited in this embodiment.
  • the user has opened the target text file 3 this time, and the user has previously opened the target.
  • the user may also operate the target text file 1 or the target text file 2 to perform the target text file 1 or the target text, respectively.
  • the subsequent steps of this embodiment only describe the process of executing the database command in the text file.
  • the specific execution is the database command in the target text file that is opened this time, or the database command in the target text file that is opened by the user, which is not specifically limited in this embodiment.
  • which text file is executed specifically is the focus file displayed by VS Code, and the displayed focus file is the target text file.
  • the subsequent steps of the embodiment mainly describe the execution process of the database command by taking the target text file opened this time as an example.
  • the embodiment mainly implements the execution of the database command in the VS Code
  • the function of the VS Code is expanded, and the corresponding extension program is executed to implement the execution of the database command, so that the extension program can be started before the step is executed.
  • This embodiment does not specifically limit the manner in which the extension program is started, including but not limited to: when the user inputs an instruction to the preset shortcut key, the extension program is started; or when the user detects the preset option in the right-click menu.
  • the extension program is started.
  • the user can type "ctrl+enter” through the keyboard to start the extension.
  • the user can also launch the extension by clicking the right mouse button and clicking on the "redisCli” option in the context menu.
  • “ctrl+enter” is the default shortcut key, which can be set by the user.
  • the “redisCli” is an extension of the program name, which can also be set by the user. This embodiment does not specifically limit this.
  • the user can generate a skeleton code by using the Yeoman VS Code Extension generator tool provided by VS Code. Add the following code to the contributions item in the package.json file of the skeleton code to support Start the extension with a shortcut or right-click menu option:
  • the extension code of the extension program is added to the extension code of the skeleton code, thereby implementing the extension program by clicking the right-click menu option or using the shortcut key.
  • this step and the subsequent steps are mainly to expand the specific implementation process of the program.
  • the subsequent implementation process needs to call the related interfaces of the VS Code module and the NodeRedis module, so that the extended program can be imported into the VS Code module and the NodeRedis module after being started, which is not specifically limited in this implementation.
  • NodeRedis is the Redis client library in the Node environment.
  • the text content displayed by the VS Code is mainly the database command line, so that the user can specify which database command lines need to be executed in the displayed text content before starting the extension program.
  • the embodiment does not specifically limit the manner in which the target text content to be executed by the user is obtained, including but not limited to: detecting a user's selected instruction for the text content; when detecting the selected instruction, according to the selected instruction The corresponding text selection range is used to obtain the target text content to be executed by the user.
  • the user can select the displayed text content through the mouse pointer, so that the terminal can obtain the target text content to be executed by the user according to the text range selected by the user.
  • all the text content may be used as the target text content to be executed by the user, which is not specifically limited in this embodiment.
  • the above process of obtaining the target text content may be performed by calling the vscode.window.activeTextEditor.selection.isEmpty interface to determine whether the currently displayed text content has the selected content.
  • the method parameter is vscode.window.activeTextEditor.selection by calling the vscode.window.activeTextEditor.document.getText() method to obtain the selected target text content.
  • all the displayed text content can be obtained by calling the vscode.window.activeTextEditor.document.getText() method, and as the target text content to be executed by the user.
  • This embodiment does not specifically limit the manner of connecting to the Redis server, including but not limited to: creating a Redis client instance; connecting to the Redis server through a Redis client instance.
  • a Redis client instance can be created by calling the createClient interface provided by the NodeRedis module.
  • This embodiment does not specifically limit this. Since the address of the Redis server needs to be known before connecting to the Redis server, the address of the Redis server can be obtained first. Correspondingly, the embodiment does not specifically limit the manner of connecting the Redis server through the Redis client instance, including but not limited to: obtaining a preset connection address in the text content; and connecting the preset connection address through the Redis client instance. Redis server.
  • the default connection address is the location of the Redis server. site.
  • the character string following the first preset character may be pre-defined as the default connection address, which is not specifically limited in this embodiment.
  • the first preset character can be set according to the user's habits, which is not specifically limited in this embodiment.
  • the preset connection address may include information such as a Redis host address, a port number, and a password. This embodiment does not specifically limit the content of the preset connection address.
  • Figure 3 shows the text content displayed by VS Code, which is the target text content to be executed by the user.
  • the first preset character is "#!.
  • the first line of content can be obtained by calling the vscode.window.activeTextEditor.document.getText() interface. Filter out the "#! in the first line of content to get the string "Redis://127.0.0.1:6379" after "#! and use it as the default connection address for the Redis server.
  • the user can be notified that the Redis server cannot be connected.
  • This embodiment does not specifically limit this.
  • the default connection address URL Uniform Relocation Locator
  • the extension program can be automatically exited to stop executing the database command, which is not specifically limited in this embodiment.
  • the created Redis client instance can be obtained.
  • the obtained URL is used as a parameter to connect to the corresponding Redis server.
  • this step 204 can be performed. Since the content of the target file may contain multiple command lines, the Redis server needs to execute the command line when executing the database command line, so that the target text content can be split and a single command line can be sent to the Redis server.
  • the embodiment does not specifically limit the manner in which the database command line is sent to the Redis server according to the content of the target text, including but not limited to: splitting the target text content into a database according to the second preset character in the target text content.
  • Command line set sends database commands and parameters to the Redis server based on the database command line set.
  • the second preset character may be set by the user when the text file is edited, which is not specifically limited in this embodiment.
  • the second preset character is a newline character.
  • the target text content can be split into an array with row content as an array item.
  • the array is the database command line set
  • the number of lines of the target text content is the number of items in the array.
  • This embodiment does not specifically limit the manner in which database commands and parameters are sent to the Redis server based on the database command line set, including but not limited to: for any database command line in the database command line set, when any database command line is detected, If it is empty and does not contain the first preset character, obtain the database command and parameters corresponding to any database command line. Send database commands and parameters corresponding to any database command line to the Redis server.
  • the target text content may contain blank lines or non-database command lines.
  • the second line and the seventh line are blank lines.
  • the first line contains the first preset character "#! and the default connection address, not the database command line. Therefore, for any database command line in the database command line collection, the database command line must first be tested. When it is detected that the database command line is not empty and does not include the first preset character, the database command and parameters corresponding to the database command line may be obtained.
  • this embodiment does not specifically limit the manner of obtaining database commands and parameters corresponding to any database command line, including but not limited to: according to the third
  • the default character is used to segment any database command line, and the first item obtained by the segmentation is used as a database command, and the subsequent content obtained by the segmentation is taken as a parameter.
  • the third preset character may be a space, which is not specifically limited in this embodiment.
  • the obtained database command and parameters can be transmitted by calling the send_command interface of the Redis client. Send database commands and parameters to the Redis server through this interface, and wait for the results to be returned.
  • the Redis server can execute the database command according to the parameters and return the corresponding result.
  • the database command is "set", and the parameters are "mykey” and “hello”, respectively, and the corresponding meaning is to set the key value of the "mykey” key to "hello".
  • the Redis server executes this database command, if the setting is successful, the result is the string "OK”.
  • the return result of the Redis server is the string "hello”.
  • the result returned by the Redis server is the number of delete keys, that is, the integer "1".
  • the return result of the Redis server is an empty object.
  • the return result is displayed in the output window of the VS Code.
  • an output window instance may be created by calling the vscode.window.createOutputChannel() interface, which is not specifically limited in this embodiment.
  • the embodiment does not specifically limit this, including but not limited to: writing a return result to the output window; displaying the output window by calling the display method of the output window instance Returns the result.
  • the preset connection address, the port, the executed database command, and the parameters of the Redis server may be written to the output window, which is not specifically limited in this embodiment.
  • the writing is performed by calling the appendLine method of the output window instance, which is not specifically limited in this embodiment.
  • the embodiment does not specifically limit the manner in which the return result is written to the output window, including but not limited to: obtaining the data type of the returned result; when the data type of the returned result is a number, writing the return number corresponding to the output window The data type and the returned number; when the data type of the returned result is a string, the returned string is written to the output window; when the data type of the returned result is an empty object, the preset keyword is written to the output window; When the data type of the returned result is an object, the returned object is converted to a string, and the converted string is written to the output window.
  • FIG. 4 is a schematic diagram showing the return result of the Redis server.
  • output indicates the following as a return result.
  • "127.0.0.1:6379>set mykey hello” is the default connection address, port, database command and parameters of the Redis server, mainly for the following return result "OK", so that the user can clearly understand each database.
  • the command returns the result corresponding to it. Since the data type of the returned result "OK” is a character string, the returned character string "OK" can be written to the output window.
  • the data type of the returned result is a number
  • the data type "(interger)" corresponding to the return number can be written to the output window, and the returned number "1" can be written.
  • the preset keyword "(nil)" can be written to the output window.
  • the keyword nil means no value.
  • JSON JavaScript Object Notation
  • the appendLine method of the output window instance can also be called for writing, which is not specifically limited in this embodiment.
  • the return result can be displayed by calling the show method of the output window instance.
  • the quit method of the Redis client instance can be invoked to close the Redis connection.
  • the user may continue to execute the database command, so that the process of the foregoing step 201 to the step 206 may be re-executed, which is not specifically limited in this embodiment.
  • the method provided by the embodiment of the present invention detects an open instruction of a text file by a user.
  • the text content in the target text file opened by the user is displayed by the VS Code.
  • the target text content to be executed by the user is acquired.
  • the returned result is displayed in the output window of VS Code. Since the corresponding database command can be executed according to the text content displayed in the opened text file based on the startup extension program, the database command is not copied or manually typed, thereby saving the command input time when the database command is executed, thereby improving the time.
  • the efficiency of database command execution is not copied or manually typed, thereby saving the command input time when the database command is executed, thereby improving the time. The efficiency of database command execution.
  • An embodiment of the present invention provides an apparatus for operating a database, and the apparatus is used to perform a method for operating a database provided by the embodiment corresponding to FIG. 1 or FIG. 2 above.
  • the device includes:
  • the first obtaining module 501 is configured to acquire, according to the displayed text content, the target text content to be executed by the user when detecting that the extension program is started, where the text content includes at least a database command line;
  • the sending module 502 is configured to send a database command line to the database server according to the target text content
  • the device further includes:
  • a detecting module configured to detect a user opening instruction for a text file
  • the second display module is configured to display the text content in the target text file opened by the user by using a preset text editor when the open command is detected.
  • the startup module is configured to start the expansion program when detecting an input instruction of the preset shortcut key by the user; or, when the user selects the selected instruction of the preset option in the right-click menu, start the expansion program.
  • a detecting unit configured to detect a user's selected instruction for the text content
  • the first obtaining unit is configured to acquire the target text content to be executed by the user according to the text selection range corresponding to the selected instruction when the selected instruction is detected.
  • a second acquiring unit configured to acquire the text content when the selected instruction is not detected, and use the text content as the target text content to be executed by the user.
  • the device further includes:
  • a connection module for connecting to a database server through a database client instance.
  • connection module includes:
  • a third obtaining unit configured to acquire a preset connection address in the text content
  • connection unit is configured to connect to the database server corresponding to the preset connection address through the database client instance.
  • the third obtaining unit is configured to detect each line of content in the text content; when the first preset character is detected in any line of content, obtain the first preset character in any line of content.
  • the following string, the string is used as the default connection address.
  • the third obtaining unit notifies the user that the database server cannot be connected when the first preset character is not detected in each line of content or the first preset character is followed by an empty character string.
  • the sending module 502 includes:
  • the sending unit is configured to send a database command and a parameter to the database server based on the database command line set.
  • the sending unit is configured to acquire any database for any database command line in the database command line set when it is detected that any database command line is not empty and does not include the first preset character.
  • the database command and parameters corresponding to the command line send database commands and parameters corresponding to any database command line to the database server.
  • the first display module includes:
  • the writing unit is configured to obtain a data type of the returned result; when the data type of the returned result is a number, the data type corresponding to the returned number and the returned number are written to the output window; when the result is returned When the data type is a string, the returned string is written to the output window; when the data type of the returned result is an empty object, the output window is output
  • the port writes the preset keyword; when the data type of the returned result is an object, the returned object is converted into a string, and the converted string is written to the output window.
  • the first obtaining module 501 is configured to call the vscode.window.activeTextEditor.selection.isEmpty interface to detect whether the user selects the text content; based on the value returned by the interface, when the user detects the text content When selected, use vscode.window.activeTextEditor.selection as the parameter, call vscode.window.activeTextEditor.document.getText to get the target text content to be executed by the user; when it detects that the user has not selected the text content, call vscode.
  • the window.activeTextEditor.document.getText method gets the text content and uses the text content as the target text content to be executed by the user.
  • the device provided by the embodiment of the present invention acquires the target text content to be executed by the user when detecting that the extension program is started based on the displayed text content.
  • the returned result is displayed in the output window. Since the start-up extension program can execute the corresponding database command according to the text content displayed in the opened text file without copying or manually typing the database command, thereby saving the command input time when the database command is executed, thereby improving The efficiency of the execution of database commands.
  • the database command can be split into multiple text files, and the corresponding database commands are respectively executed by opening multiple text files. Therefore, it is convenient for the user to manage the execution flow of the database command.
  • FIG. 6 is a structural block diagram showing an apparatus for operating a database according to Embodiment 4 of the present application.
  • the device for operating a database includes: a processor Processor 601, memory 602 and bus 603;
  • the processor 601 and the memory 602 complete communication with each other through the bus 603.
  • the processor 601 is configured to invoke the program instructions in the memory 602 to perform the method provided by the foregoing method embodiments, for example, including: based on the displayed text content, when detecting that the extension program is started, acquiring the user to perform Target text content, the displayed text content includes at least a database command line; according to the target text content, sending a database command line to the database server; obtaining a return result of the database server; displaying the returned result in an output window.
  • the embodiment discloses a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions, when the program instructions are executed by a computer, the computer
  • the method provided by each of the foregoing method embodiments can include, for example, acquiring, based on the displayed text content, the target text content to be executed by the user when the extension program is started, and the displayed text content includes at least a database command line; Descriptive text content, sending a database command line to the database server; obtaining a return result of the database server; displaying the returned result in an output window.
  • the foregoing program may be stored in a computer readable storage medium, and the program is executed when executed.
  • the foregoing steps include the steps of the foregoing method embodiments; and the foregoing storage medium includes: a medium that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • User Interface Of Digital Computer (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种操作数据库的方法及装置,属于计算机程序开发技术领域。该方法包括:基于显示的文本内容,当检测到拓展程序启动时,获取用户要执行的目标文本内容(101);根据目标文本内容,向数据库服务器发送数据库命令行(102);获取数据库服务器的返回结果(103);在输出窗口中显示返回结果(104)。通过在检测到拓展程序启动时,获取用户要执行的目标文本内容。根据目标文本内容向数据库服务器发送数据库命令行。获取数据库服务器的返回结果并显示返回结果。由于可基于启动的拓展程序,根据打开的文本文件中显示的文本内容,来执行对应的数据库命令,而不用复制或手动键入数据库命令,从而节省了数据库命令执行时的命令输入时间,进而提高数据库命令的执行效率。

Description

一种操作数据库的方法及装置
交叉引用
本申请引用于2016年12月9日提交的专利名称为“一种操作数据库的方法及装置”的第2016111314162号中国专利申请,其通过引用被全部并入本申请。
技术领域
本发明涉及计算机程序开发技术领域,更具体地,涉及一种操作数据库的方法及装置。
背景技术
随着计算机信息技术的快速发展,技术人员在进行程序开发时,通常需要执行数据库命令来测试程序在调用数据库时的输出结果。由于当数据库命令较复杂时,如何执行数据库命令影响着开发效率,从而如何执行数据库命令是个重点问题。现有操作数据库的方法主要是技术人员先创建一个数据库客户端实例,并在数据库客户端实例中手动键入数据库命令,从而通过数据库客户端实例执行数据库命令。
在实现本发明的过程中,发现现有技术至少存在以下问题:由于当数据库命令较复杂时,手动键入数据库命令需要耗费大量时间,且键入时容易出错,从而导致对数据库操作时不太方便,数据库命令的执行效率较低。
发明内容
本申请的目的在于,提供一种操作数据库的方法及装置,可以改善现有数据库操作过程中数据库操作不太方便,数据库命令的执行效率较低的问题。
第一方面,本申请的实施例提供了一种操作数据库的方法,包括:
基于显示的文本内容,当检测到拓展程序启动时,获取用户要执行的目标文本内容,显示的文本内容至少包含数据库命令行;
根据目标文本内容,向数据库服务器发送数据库命令行;
获取数据库服务器的返回结果;
在输出窗口中显示返回结果。
可选地,所述获取用户要执行的目标文本内容之前,还包括:
检测用户对文本文件的打开指令;
当检测到打开指令时,通过所述预设文本编辑器,显示用户打开的目标文本文件中的文本内容。
可选地,所述获取用户要执行的目标文本内容,包括:
检测用户对所述文本内容的选中指令;
当检测到选中指令时,根据所述选中指令所对应的文本选中范围,获取用户要执行的目标文本内容。
可选地,所述根据所述目标文本内容,向数据库服务器发送数据库命令行之前,还包括:
创建数据库客户端实例;
通过所述数据库客户端实例,连接数据库服务器。
可选地,所述通过所述数据库客户端实例,连接数据库服务器,包括:
获取所述文本内容中的预设连接地址;
通过所述数据库客户端实例,连接所述预设连接地址对应的数据库服务器。
可选地,获取所述文本内容中的预设连接地址,包括:
对所述文本内容中的每一行内容进行检测;
当在任一行内容中检测到第一预设字符时,获取所述任一行内容中所述第一预设字符后面的字符串,将所述字符串作为预设连接地址。
可选地,所述根据所述目标文本内容,向数据库服务器发送数据库命令行,包括:
根据所述目标文本内容中的第二预设字符,将所述目标文本内容拆分成数据库命令行集合;
基于所述数据库命令行集合,向所述数据库服务器发送数据库命令及参数。
可选地,所述在输出窗口中显示所述返回结果,包括:
向所述输出窗口写入所述返回结果;
通过调用输出窗口实例的显示方法,在所述输出窗口中显示所述返回结果。
可选地,所述预设文本编辑器为VS Code,所述数据库服务器为Redis服务器,所述获取用户要执行的目标文本内容,包括:
调用vscode.window.activeTextEditor.selection.isEmpty接口,检测用户是否对所述文本内容进行选中;
基于所述接口返回的数值,当检测到用户对所述文本内容进行选中时,以vscode.window.activeTextEditor.selection为参数,调用vscode.window.activeTextEditor.document.getText方法获取用户要执行的目标文本内容;
当检测到用户未对所述文本内容进行选中时,调用vscode.window.activeTextEditor.document.getText方法,获取所述文本内容,并将所述文本内容作为用户要执行的目标文本内容。
第二方面,本申请的实施例还提供了一种操作数据库的装置,包括:
第一获取模块,用于基于显示的文本内容,当检测到拓展程序启动时,获取用户要执行的目标文本内容,显示的文本内容至少包含数据库命令行;
发送模块,用于根据目标文本内容,向数据库服务器发送数据库命令行;
第二获取模块,用于获取数据库服务器的返回结果;
显示模块,用于在输出窗口中显示返回结果。
可选地,该装置还包括:
检测模块,用于检测用户对文本文件的打开指令;
第二显示模块,用于在检测到打开指令时,通过预设文本编辑器,显示用户打开的目标文本文件中的文本内容。
可选地,该装置还包括:
启动模块,用于在检测到用户对预设快捷键的输入指令时,启动拓展程序;或者,当检测到用户对右键菜单中预设选项的选中指令时,启动拓展程序。
可选地,第一获取模块,包括:
检测单元,用于检测用户对文本内容的选中指令;
第一获取单元,用于在检测到选中指令时,根据选中指令所对应的文本选中范围,获取用户要执行的目标文本内容。
可选地,第一获取模块,还包括:
第二获取单元,用于在未检测到选中指令时,获取文本内容,并将文本内容作为用户要执行的目标文本内容。
可选地,该装置还包括:
创建模块,用于创建数据库客户端实例;
连接模块,用于通过数据库客户端实例,连接数据库服务器。
可选地,连接模块,包括:
第三获取单元,用于获取文本内容中的预设连接地址;
连接单元,用于通过数据库客户端实例,连接预设连接地址对应的数据库服务器。
可选地,第三获取单元,用于对文本内容中的每一行内容进行检测;当在任一行内容中检测到第一预设字符时,获取任一行内容中第一预设字符后面的字符串,将字符串作为预设连接地址。
可选地,第三获取单元,用于当在每一行内容中未检测到第一预设字符或第一预设字符后面为空字符串时,通知用户无法连接数据库服务器。
可选地,发送模块,包括:
拆分单元,用于根据目标文本内容中的第二预设字符,将目标文本内
容拆分成数据库命令行集合;
发送单元,用于基于数据库命令行集合,向数据库服务器发送数据库命令及参数。
可选地,发送单元,用于对于数据库命令行集合中任一数据库命令行,当检测到任一数据库命令行不为空且不包含第一预设字符时,获取任一数据库命令行对应的数据库命令及参数;向数据库服务器发送任一数据库命令行对应的数据库命令及参数。
可选地,第一显示模块,包括:
写入单元,用于向输出窗口写入返回结果;
显示单元,用于通过调用输出窗口实例的显示方法,在输出窗口中显示返回结果。
可选地,写入单元,用于获取返回结果的数据类型;当返回结果的数据类型为数字时,向输出窗口写入返回数字对应的数据类型及返回的数字;当返回结果的数据类型为字符串时,向输出窗口写入返回的字符串;当返回结果的数据类型为空对象时,向输出窗口写入预设关键字;当返回结果的数据类型为对象时,将返回的对象转换为字符串,向输出窗口写入转换后的字符串。
可选地,第一获取模块,用于调用
vscode.window.activeTextEditor.selection.isEmpty接口,检测用户是否对文本内容进行选中;基于接口返回的数值,当检测到用户对文本内容进行选中时,以vscode.window.activeTextEditor.selection为参数,调用vscode.window.activeTextEditor.document.getText方法获取用户要执行的目标文本内容;当检测到用户未对文本内容进行选中时,调用vscode.window.activeTextEditor.document.getText方法,获取文本内容,并将文本内容作为用户要执行的目标文本内容。
第三方面,本申请的实施例还提供了一种操作数据库的设备,包括:
至少一个处理器;以及
与所述处理器通信连接的至少一个存储器,其中:
所述存储器存储有可被所述处理器执行的程序指令,所述处理器调用所述程序指令能够执行如下方法:
基于显示的文本内容,当检测到拓展程序启动时,获取用户要执行的目标文本内容,显示的文本内容至少包含数据库命令行;
根据所述目标文本内容,向数据库服务器发送数据库命令行;
获取所述数据库服务器的返回结果;
在输出窗口中显示所述返回结果。
第四方面,本申请的实施例还提供了一种计算机程序,包括程序代码,所述程序代码用于执行如下操作:
所述处理器用于调用所述存储器中的逻辑指令,以执行如下方法:
基于显示的文本内容,当检测到拓展程序启动时,获取用户要执行的目标文本内容,显示的文本内容至少包含数据库命令行;
根据所述目标文本内容,向数据库服务器发送数据库命令行;
获取所述数据库服务器的返回结果;
在输出窗口中显示所述返回结果。
第五方面,本申请的实施例还提供了一种存储介质,用于存储如前所述的计算机程序。
本申请实施例提供的一种操作数据库的方法,通过基于显示的文本内容,当检测到拓展程序启动时,获取用户要执行的目标文本内容。根据目标文本内容,向数据库服务器发送数据库命令行。获取数据库服务器的返回结果。在输出窗口中显示返回结果。由于可基于启动的拓展程序,根据打开的文本文件中显示的文本内容,来执行对应的数据库命令,而不用复制或手动键入数据库命令,从而节省了数据库命令执行时的命令输入时间,进而提高了数据库命令的执行效率。
另外,由于在预设文本编辑器中可打开多个文本文件,当用户需要执行大量数据库命令时,可将数据库命令拆分成多个文本文件,通过打开多个文本文件分别执行对应的数据库命令,从而能够便于用户对数据库命令的执行流程进行管理。
附图说明
图1为本发明一个实施例中一种操作数据库的方法的步骤流程示意图;
图2为本发明又一实施例中一种操作数据库的方法的步骤流程示意图;
图3为本发明一个实施例中一种文本内容的显示示意图;
图4为本发明一个实施例中一种数据库命令执行结果的显示示意图;
图5为本发明一个实施例中一种操作数据库的装置的结构框图;
图6为本发明一个实施例中一种操作数据库的设备的结构框图。
具体实施方式
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
实施例一
现有操作数据库的方法主要是由技术人员先通过数据库软件创建一个数据库客户端实例,并在数据库客户端实例中手动键入数据库命令。或者,复制一段数据库命令至数据库客户端实例。由于上述两种方式都需要手动创建数据库客户端实例,且无论是手动键入还是复制数据库命令均耗费较长时间并容易出错,从而导致对数据库操作时不 太方便,数据库命令的执行效率较低。
针对现有技术中的问题,本发明实施例提供了一种操作数据库的方法。本实施例及后续实施例所提供的一种操作数据库的方法,适用于安装任一类型操作系统的终端。其中,适用的操作系统可以为Windows操作系统、Linux操作系统或OS X操作系统,本实施例对此不作具体限定。
图1是本发明实施例提供的一种操作数据库的方法的步骤流程示意图。参见图1,本实施例提供的方法流程包括:101、基于显示的文本内容,当检测到拓展程序启动时,获取用户要执行的目标文本内容;102、根据目标文本内容,向数据库服务器发送数据库命令行;103、获取数据库服务器的返回结果;104、在输出窗口中显示返回结果。
其中,显示的文本内容至少包含数据库命令行,本实施例及后续实施例对此不作具体限定。数据库服务器可以为Redis服务器、SSDB服务器或Hbase服务器等,本实施例及后续实施例对此不作具体限定。
本发明实施例提供的方法,通过基于显示的文本内容,当检测到拓展程序启动时,获取用户要执行的目标文本内容。根据目标文本内容,向数据库服务器发送数据库命令行。获取数据库服务器的返回结果。在输出窗口中显示返回结果。由于可基于启动的拓展程序,根据打开的文本文件中显示的文本内容,来执行对应的数据库命令,而不用复制或手动键入数据库命令,从而节省了数据库命令执行时的命令输入时间,进而提高了数据库命令的执行效率。
另外,由于在预设文本编辑器中可打开多个文本文件,当用户需要执行大量数据库命令时,可将数据库命令拆分成多个文本文件,通过打开多个文本文件分别执行对应的数据库命令,从而能够便于用户对数据库命令的执行流程进行管理。
作为一种可选实施例,获取用户要执行的目标文本内容之前,还包括:
检测用户对文本文件的打开指令;
当检测到打开指令时,通过预设文本编辑器,显示用户打开的目标文本文件中的文本内容。
其中,预设文本编辑器可以为程序开发所使用的开源文本编辑器,如Visual Studio Code(简称VS Code)、Sublime Text、Atom、VIM或Notepad++等,本实施例及后续实施例对此不作具体限定。
作为一种可选实施例,获取用户要执行的目标文本内容之前,还包括:
当检测到用户对预设快捷键的输入指令时,启动拓展程序;
或者,当检测到用户对右键菜单中预设选项的选中指令时,启动拓展程序。
作为一种可选实施例,获取用户要执行的目标文本内容,包括:
检测用户对文本内容的选中指令;
当检测到选中指令时,根据选中指令所对应的文本选中范围,获取用户要执行的目标文本内容。
作为一种可选实施例,检测用户对文本内容的选中指令之后,还包括:
当未检测到选中指令时,获取文本内容,并将文本内容作为用户要执行的目标文本内容。
作为一种可选实施例,根据目标文本内容,向数据库服务器发送数据库命令行之前,还包括:
创建数据库客户端实例;
通过数据库客户端实例,连接数据库服务器。
作为一种可选实施例,通过数据库客户端实例,连接数据库服务器,包括:
获取文本内容中的预设连接地址;
通过数据库客户端实例,连接预设连接地址对应的数据库服务器。
作为一种可选实施例,获取文本内容中的预设连接地址,包括:
对文本内容中的每一行内容进行检测;
当在任一行内容中检测到第一预设字符时,获取任一行内容中第一预设字符后面的字符串,将字符串作为预设连接地址。
作为一种可选实施例,对文本内容中的每一行内容进行检测之后,包括:
当在每一行内容中未检测到第一预设字符或第一预设字符后面为空字符串时,通知用户无法连接数据库服务器。
作为一种可选实施例,根据目标文本内容,向数据库服务器发送数据库命令行,包括:
根据目标文本内容中的第二预设字符,将目标文本内容拆分成数据库命令行集合;
基于数据库命令行集合,向数据库服务器发送数据库命令及参数。
作为一种可选实施例,基于数据库命令行集合,向数据库服务器发送数据库命令行,包括:
对于数据库命令行集合中任一数据库命令行,当检测到任一数据库命令行不为空且不包含第一预设字符时,获取任一数据库命令行对应的数据库命令及参数。
向数据库服务器发送任一数据库命令行对应的数据库命令及参数。
作为一种可选实施例,在输出窗口中显示返回结果,包括:
向输出窗口写入返回结果;
通过调用输出窗口实例的显示方法,在输出窗口中显示返回结果。
作为一种可选实施例,向输出窗口写入返回结果,包括:
获取返回结果的数据类型;
当返回结果的数据类型为数字时,向输出窗口写入返回数字对应的数据类型及返回的数字;
当返回结果的数据类型为字符串时,向输出窗口写入返回的字符串;
当返回结果的数据类型为空对象时,向输出窗口写入预设关键字;
当返回结果的数据类型为对象时,将返回的对象转换为字符串,向输出窗口写入转换后的字符串。
作为一种可选实施例,预设文本编辑器为VS Code,数据库服务器为Redis服务器,获取用户要执行的目标文本内容,包括:
调用vscode.window.activeTextEditor.selection.isEmpty接口,检测用户是否对文本内容进行选中;
基于接口返回的数值,当检测到用户对文本内容进行选中时,以vscode.window.activeTextEditor.selection为参数,调用vscode.window.activeTextEditor.document.getText方法获取用户要执行的目标文本内容;
当检测到用户未对文本内容进行选中时,调用vscode.window.activeTextEditor.document.getText方法,获取文本内容,并将文本内容作为用户要执行的目标文本内容。
上述所有可选技术方案,可以采用任意结合形成本发明的可选实施例,在此不再一一赘述。
实施例二
基于上述图1对应实施例中的内容,本发明实施例提供了一种更具体的操作数据库的方法。为了便于对方案进行阐述,本实施例以预设文本编辑器为VS Code,数据库为Redis为例,来对数据库命令执行方法的过程进行说明。其中,VS Code是一个由微软开发且同时支持Windows、Linux及OS x操作系统的开源文本编辑器,VS Code支持扩展程序并内置了扩展程序管理功能。Redis是一个开源、支持网络且基于内存的键值对存储数据库。
图2是本发明实施例中一种操作数据库的方法的步骤流程示意图。参见图2,本实施例提供的方法流程包括:201、检测用户对文本文件的打开指令;202、当检测到打开指令时,通过VS Code显示用户打开的目标文本文件中的文本内容;203、基于显示的文本内容,当检测到 拓展程序启动时,获取用户要执行的目标文本内容;204、根据目标文本内容,向Redis服务器发送数据库命令行;205、获取Redis服务器的返回结果;206、在VS Code的输出窗口中显示返回结果。
其中,201、检测用户对文本文件的打开指令。
由于本实施例提供的方法主要是基于在VS Code中打开的文本文件,实现执行文本文件中的数据库命令,从而在执行本步骤之前,用户(即相关程序开发人员)可以根据实际需求预先编辑包含数据库命令行的文本文件,本实施例对此不作具体限定。其中,用户根据实际程序开发需求,可编辑多个包含数据库命令行的文本文件存储在预设目录中。
在执行本步骤时,可检测用户对文本文件的打开指令。相应地,用户可在预设目录中选中一个包含数据库命令行的文本文件,并通过VS Code打开该文本文件,即输入打开指令。
其中,202、当检测到打开指令时,通过VS Code,显示用户打开的目标文本文件中的文本内容。
本步骤主要是通过VS Code打开文本文件的过程,打开的文本文件可作为目标文本文件。其中,目标文本文件中的文本内容可包含数据库命令行、Redis服务器的地址及连接端口等,本实施例不对目标文本文件包含的内容作具体限定。
需要说明的是,本步骤的后续步骤主要是将打开的文本文件作为目标文本文件,基于目标文本文件实现执行数据库命令的过程。由于文本编辑器通常支持同时打开多个文本文件,从而在本次打开目标文本文件之前,用户可以按照本步骤及上述步骤201打开多个其它的文本文件,本实施例对此不作具体限定。相应地,用户后续除了可对本次打开的目标文本文件进行操作以实现执行数据库命令之外,还可以对之前打开目标文本文件进行操作以实现执行数据库命令,本实施例对此不作具体限定。
例如,用户本次打开了目标文本文件3,而用户之前还打开了目标 文本文件1及目标文本文件2。用户后续除了可对目标文本文件3进行操作,以执行目标文本文件3中的数据库命令之外,还可以对目标文本文件1或目标文本文件2进行操作,从而分别执行目标文本文件1或目标文本文件2中的数据库命令。
基于上述内容,需要说明的是,本实施例的后续步骤仅对执行文本文件中数据库命令的过程进行说明。然而,具体执行的是本次打开的目标文本文件中的数据库命令,还是执行用户之前打开的目标文本文件中的数据库命令,本实施例对此不作具体限定。实际实施中,具体执行哪个文本文件以VS Code显示的焦点文件为主,显示的焦点文件即为目标文本文件。基于方案的完整性且为了便于说明,本实施例的后续步骤主要以本次打开的目标文本文件为例,对数据库命令的执行过程进行说明。
其中,203、基于显示的文本内容,当检测到拓展程序启动时,获取用户要执行的目标文本内容。
由于本实施例主要是在VS Code中实现数据库命令的执行,即对VS Code的功能进行了拓展,执行相应的拓展程序以实现执行数据库命令,从而在执行本步骤之前还可以启动拓展程序。本实施例不对启动拓展程序的方式作具体限定,包括但不限于:当检测到用户对预设快捷键的输入指令时,启动拓展程序;或者,当检测到用户对右键菜单中预设选项的选中指令时,启动拓展程序。
例如,用户可通过键盘键入“ctrl+enter”以启动拓展程序。或者,用户还可以通过点击鼠标右键,在右键菜单中点击“redisCli”选项以启动拓展程序。其中,“ctrl+enter”即为预设快捷键,可由用户自行设置。“redisCli”为拓展程序名称,同样可由用户自行设置,本实施例对此不作具体限定。
具体地,在启动拓展程序之前,用户可利用VS Code官方提供的Yeoman VS Code Extension generator工具,生成一份骨架代码。向骨架代码的package.json文件中contributes项中加入以下代码,以支持 通过快捷键或右键菜单选项启动拓展程序:
Figure PCTCN2017076038-appb-000001
该过程通过VS Code的内置方案,向项目配置文件package.json中加入对应的配置。当VS Code启动时,拓展的package.json文件便会被读取,并且VS Code还会对package.json文件中的contributes项的内容做处理。
上述配置完成后,通过向骨架代码的extension.ts文件中加入拓展程序的具体实现代码,从而实现通过点击右键菜单选项或使用快捷键运行扩展程序。相应地,本步骤及后续步骤主要是拓展程序的具体实现过程。需要说明的是,由于后续实现过程需要调用VS Code模块和NodeRedis模块的相关接口,从而拓展程序在启动后可导入VS Code模块和NodeRedis模块,本实施对此不作具体限定。其中,NodeRedis为Node环境下的Redis客户端库。
基于上述过程,拓展程序在启动后,由于VS Code显示的文本内容主要为数据库命令行,从而用户在启动拓展程序之前可指定显示的文本内容中哪些数据库命令行需要执行。相应地,本实施例不对获取用户要执行的目标文本内容的方式作具体限定,包括但不限于:检测用户对文本内容的选中指令;当检测到选中指令时,根据选中指令所 对应的文本选中范围,获取用户要执行的目标文本内容。
例如,用户可通过鼠标指针对显示的文本内容进行选中,从而终端可根据用户选中的文本范围,获取用户要执行的目标文本内容。
由于用户在启动拓展程序之后,用户之前可能并未选中任何显示的文本内容,此时可将所有文本内容作为用户要执行的目标文本内容,本实施例对此不作具体限定。
基于拓展程序导入的VS Code模块,上述获取目标文本内容的过程,可通过调用vscode.window.activeTextEditor.selection.isEmpty接口,判断当前显示的文本内容是否有被选中的内容。当检测到被选中的内容时,可通过调用vscode.window.activeTextEditor.document.getText()方法,该方法参数为vscode.window.activeTextEditor.selection,以获取选中的目标文本内容。当没有检测到被选中的内容时,可通过调用vscode.window.activeTextEditor.document.getText()方法,获取显示的所有文本内容,并作为用户要执行的目标文本内容。
其中,204、根据目标文本内容,向Redis服务器发送数据库命令行。
由于后续步骤需要执行数据库命令,而在执行数据库命令之前需要与Redis服务器进行连接,从而在执行本步骤之前若检测到没有连接至Redis服务器,可先与Redis服务器进行连接。本实施例不对连接Redis服务器的方式作具体限定,包括但不限于:创建Redis客户端实例;通过Redis客户端实例,连接Redis服务器。
在创建Redis客户端实例时,可通过调用NodeRedis模块提供的createClient接口,创建一个Redis客户端实例,本实施例对此不作具体限定。由于在连接Redis服务器之前,需要先知道Redis服务器的地址,从而可先获取Redis服务器的地址。相应地,本实施例不对通过Redis客户端实例,连接Redis服务器的方式作具体限定,包括但不限于:获取文本内容中的预设连接地址;通过Redis客户端实例,连接预设连接地址对应的Redis服务器。其中,预设连接地址即为Redis服务器的地 址。
由于用户在编辑文本文件时,可在文本文件中置入要连接的Redis服务器对应的地址,从而可在显示的文本内容中检测出预设连接地址。关于获取文本内容中的预设连接地址的方式,本实施例对此不作具体限定,包括但不限于:对文本内容中的每一行内容进行检测;当在任一行内容中检测到第一预设字符时,获取任一行内容中第一预设字符后面的字符串,将字符串作为预设连接地址。
用户在编辑文本文件中的文本内容时,对于每一行内容,可预先约定第一预设字符后面的字符串为预设连接地址,本实施例对此不作具体限定。其中,第一预设字符可根据用户习惯自行设置,本实施例对此不作具体限定。预设连接地址可包括Redis主机地址、端口号及密码等信息,本实施例不对预设连接地址的内容作具体限定。
例如,以用户要执行的目标文本内容为显示的所有文本内容为例。图3为VS Code显示的文本内容,也即为用户要执行的目标文本内容。在图3中,第一预设字符为“#!”。通过对每一行内容进行检测,可确定第一行内容中包含第一预设字符“#!”。通过调用vscode.window.activeTextEditor.document.getText()接口,可获取第一行内容。过滤掉第一行内容中的“#!”,可获取“#!”后面的字符串“Redis://127.0.0.1:6379”,并作为Redis服务器的预设连接地址。
由于存在找不到预设连接地址的可能性,从而对文本内容中的每一行内容进行检测之后,当在每一行内容中未检测到第一预设字符或第一预设字符后面为空字符串时,可通知用户无法连接Redis服务器,本实施例对此不作具体限定。具体地,在向用户通知时,可通过调用vscode.window.showErrorMessage()方法,向用户报告预设连接地址URL(Uniform Resoure Locator,统一资源定位器)为空。同时,还可以自动退出拓展程序以停止执行数据库命令,本实施例对此不作具体限定。
在获取到预设连接地址URL后,创建的Redis客户端实例可以获 取到的URL作为参数,连接对应的Redis服务器。当连接至Redis服务器后,可再执行本步骤204。由于目标文件内容中可能会包含多条命令行,而Redis服务器在执行数据库命令行时需要一条条地执行,从而可对目标文本内容进行拆分,向Redis服务器发送单条命令行。
相应地,本实施例不对根据目标文本内容,向Redis服务器发送数据库命令行的方式作具体限定,包括但不限于:根据目标文本内容中的第二预设字符,将目标文本内容拆分成数据库命令行集合;基于数据库命令行集合,向Redis服务器发送数据库命令及参数。其中,第二预设字符可根据用户在编辑文本文件时自行设置,本实施例对此不作具体限定。
例如,如图3所示。在图3中,第二预设字符为换行符。通过将换行符作为分隔符,将每一行内容作为一个数组项,可将目标文本内容拆分成一个以行内容为数组项的数组。其中,数组即为数据库命令行集合,目标文本内容的行数即为数组的项数。
在得到数据库命令行集合后,可向Redis服务器发送数据库命令及参数。本实施例不对基于数据库命令行集合,向Redis服务器发送数据库命令及参数的方式作具体限定,包括但不限于:对于数据库命令行集合中任一数据库命令行,当检测到任一数据库命令行不为空且不包含第一预设字符时,获取任一数据库命令行对应的数据库命令及参数。向Redis服务器发送任一数据库命令行对应的数据库命令及参数。
由图3可知,目标文本内容中可能会包含空行或者非数据库命令行。例如,在图3中第2行与第7行为空行。第1行的内容包含第一预设字符“#!”及预设连接地址,而非数据库命令行。因此,对于数据库命令行集合中任一数据库命令行,先要对该数据库命令行进行检测。当检测到该数据库命令行不为空且不包含第一预设字符时,可获取该数据库命令行对应的数据库命令及参数。
对于任一数据库命令行,本实施例不对获取任一数据库命令行对应的数据库命令及参数的方式作具体限定,包括但不限于:按照第三 预设字符对任一数据库命令行进行切分,将切分得到的第一项内容作为数据库命令,将切分得到的后续内容作为参数。其中,第三预设字符可以为空格,本实施例对此不作具体限定。
例如,如图3所示。以第3行的内容为例,可将第3行的行内容按照空格进行切分,并将切分后得到的每一项内容存入数组中。相应地,数组第一项内容“set”即为数据库命令,数组的第二项内容“mykey”及第三项内容“hello”即为参数。
在获取数据命令行对应的数据库命令及参数后,可通过调用Redis客户端的send_command接口,传入得到的数据库命令及参数。通过该接口向Redis服务器发送数据库命令及参数,并等待返回结果。
其中,205、获取Redis服务器的返回结果。
通过上述步骤204,在向Redis服务器发送数据库命令及参数之后,Redis服务器可根据参数执行数据库命令,并返回相应的结果。
例如,图3中第3行内容中数据库命令为“set”,参数分别为“mykey”及“hello”,其对应的含义为将“mykey”键的键值设置为“hello”。Redis服务器在执行这条数据库命令时,如果设置成功的话,返回结果为字符串“OK”。同理,对于第4行内容对应的数据库命令,Redis服务器的返回结果为字符串“hello”。对于第5行内容对应的数据库命令,Redis服务器的返回结果为删除键的个数,即整数“1”。对于第5行内容对应的数据库命令,由于之前已经对键进行删除,从而Redis服务器的返回结果为空对象。
其中,206、在VS Code的输出窗口中显示返回结果。
在执行本步骤之前,可先创建一个输出窗口实例,以显示返回结果。具体地,可通过调用vscode.window.createOutputChannel()接口,创建一个输出窗口实例,本实施例对此不作具体限定。
关于在VS Code的输出窗口中显示返回结果的方式,本实施例对此不作具体限定,包括但不限于:向输出窗口写入返回结果;通过调用输出窗口实例的显示方法,在输出窗口中显示返回结果。
在向输出窗口写入返回结果之前,可先向输出窗口写入Redis服务器的预设连接地址、端口、执行的数据库命令及参数,本实施例对此不作具体限定。具体地,可通过调用输出窗口实例的appendLine方法进行写入,本实施例对此不作具体限定。基于上述写入过程,后续在显示返回结果时,能让用户清楚地了解到每条数据库命令是哪个Redis服务器执行的、执行端口是什么以及每条数据库命令对应的执行结果是什么,即达到便于用户查看的目的。
由于返回结果对应的数据类型决定了如何将返回结果写入输出窗口,从而可根据返回结果的数据类型,对返回结果进行写入。相应地,本实施例不对向输出窗口写入返回结果的方式作具体限定,包括但不限于:获取返回结果的数据类型;当返回结果的数据类型为数字时,向输出窗口写入返回数字对应的数据类型及返回的数字;当返回结果的数据类型为字符串时,向输出窗口写入返回的字符串;当返回结果的数据类型为空对象时,向输出窗口写入预设关键字;当返回结果的数据类型为对象时,将返回的对象转换为字符串,向输出窗口写入转换后的字符串。
例如,图4为对Redis服务器的返回结果进行显示后的示意图。在图4中,output表示下列内容为返回结果。“127.0.0.1:6379>set mykey hello”为Redis服务器的预设连接地址、端口、执行的数据库命令及参数,主要是为了与下面的返回结果“OK”对应,让用户清楚地了解每条数据库命令与其对应的返回结果。由于返回结果“OK”的数据类型为字符串,从而可向输出窗口写入返回的字符串“OK”。
同理,当返回结果的数据类型为数字时,如图4所示,可向输出窗口写入返回数字对应的数据类型“(interger)”整型,再写入返回的数字“1”。
当返回结果的数据类型为空对象时,如图4所示,可向输出窗口写入预设关键字“(nil)”。其中,关键字nil表示无值。
当返回结果的数据类型为对象时,可通过调用JSON的stringify 方法将对象转换成字符串,向输出窗口写入转换后的字符串。其中,JSON(JavaScript Object Notation,JavaScript对象表示法)是一种轻量级的数据交换语言,以文字为基础且易于让人阅读。
需要说明的是,在向输出窗口写入返回结果时,同样可调用输出窗口实例的appendLine方法进行写入,本实施例对此不作具体限定。在向输出窗口写入返回结果后,可通过调用输出窗口实例的show方法,显示返回结果。
另外,当对返回结果进行显示后,可调用Redis客户端实例的quit方法以关闭Redis连接。或者,考虑到用户可能还要继续执行数据库命令,从而还可以重新执行上述步骤201至本步骤206的过程,本实施例对此不作具体限定。
本发明实施例提供的方法,通过检测用户对文本文件的打开指令。当检测到打开指令时,通过VS Code,显示用户打开的目标文本文件中的文本内容。基于显示的文本内容,当检测到拓展程序启动时,获取用户要执行的目标文本内容。根据目标文本内容,向Redis服务器发送数据库命令行。获取Redis服务器的返回结果。在VS Code的输出窗口中显示返回结果。由于可基于启动的拓展程序,根据打开的文本文件中显示的文本内容,来执行对应的数据库命令,而不用复制或手动键入数据库命令,从而节省了数据库命令执行时的命令输入时间,进而提高了数据库命令的执行效率。
另外,由于在预设文本编辑器中可打开多个文本文件,当用户需要执行大量数据库命令时,可将数据库命令拆分成多个文本文件,通过打开多个文本文件分别执行对应的数据库命令,从而能够便于用户对数据库命令的执行流程进行管理。
最后,由于在执行数据库命令时,可通过检测到的预设连接地址,自动连接对应的数据库服务器,从而进一步地提高了数据库命令的执行效率。
实施例三
本发明实施例提供了一种操作数据库的装置,该装置用于执行上述图1或图2对应的实施例所提供的一种操作数据库的方法。参见图5,该装置包括:
第一获取模块501,用于基于显示的文本内容,当检测到拓展程序启动时,获取用户要执行的目标文本内容,文本内容至少包含数据库命令行;
发送模块502,用于根据目标文本内容,向数据库服务器发送数据库命令行;
第二获取模块503,用于获取数据库服务器的返回结果;
第一显示模块504,用于在输出窗口中显示返回结果。
作为一种可选实施例,该装置还包括:
检测模块,用于检测用户对文本文件的打开指令;
第二显示模块,用于在检测到打开指令时,通过预设文本编辑器,显示用户打开的目标文本文件中的文本内容。
作为一种可选实施例,该装置还包括:
启动模块,用于在检测到用户对预设快捷键的输入指令时,启动拓展程序;或者,当检测到用户对右键菜单中预设选项的选中指令时,启动拓展程序。
作为一种可选实施例,第一获取模块501,包括:
检测单元,用于检测用户对文本内容的选中指令;
第一获取单元,用于在检测到选中指令时,根据选中指令所对应的文本选中范围,获取用户要执行的目标文本内容。
作为一种可选实施例,第一获取模块501,还包括:
第二获取单元,用于在未检测到选中指令时,获取文本内容,并将文本内容作为用户要执行的目标文本内容。
作为一种可选实施例,该装置还包括:
创建模块,用于创建数据库客户端实例;
连接模块,用于通过数据库客户端实例,连接数据库服务器。
作为一种可选实施例,连接模块,包括:
第三获取单元,用于获取文本内容中的预设连接地址;
连接单元,用于通过数据库客户端实例,连接预设连接地址对应的数据库服务器。
作为一种可选实施例,第三获取单元,用于对文本内容中的每一行内容进行检测;当在任一行内容中检测到第一预设字符时,获取任一行内容中第一预设字符后面的字符串,将字符串作为预设连接地址。
作为一种可选实施例,第三获取单元,当在每一行内容中未检测到第一预设字符或第一预设字符后面为空字符串时,通知用户无法连接数据库服务器。
作为一种可选实施例,发送模块502,包括:
拆分单元,用于根据目标文本内容中的第二预设字符,将目标文本内容拆分成数据库命令行集合;
发送单元,用于基于数据库命令行集合,向数据库服务器发送数据库命令及参数。
作为一种可选实施例,发送单元,用于对于数据库命令行集合中任一数据库命令行,当检测到任一数据库命令行不为空且不包含第一预设字符时,获取任一数据库命令行对应的数据库命令及参数;向数据库服务器发送任一数据库命令行对应的数据库命令及参数。
作为一种可选实施例,第一显示模块,包括:
写入单元,用于向输出窗口写入返回结果;
显示单元,用于通过调用输出窗口实例的显示方法,在输出窗口中显示返回结果。
作为一种可选实施例,写入单元,用于获取返回结果的数据类型;当返回结果的数据类型为数字时,向输出窗口写入返回数字对应的数据类型及返回的数字;当返回结果的数据类型为字符串时,向输出窗口写入返回的字符串;当返回结果的数据类型为空对象时,向输出窗 口写入预设关键字;当返回结果的数据类型为对象时,将返回的对象转换为字符串,向输出窗口写入转换后的字符串。
作为一种可选实施例,第一获取模块501,用于调用vscode.window.activeTextEditor.selection.isEmpty接口,检测用户是否对文本内容进行选中;基于接口返回的数值,当检测到用户对文本内容进行选中时,以vscode.window.activeTextEditor.selection为参数,调用vscode.window.activeTextEditor.document.getText方法获取用户要执行的目标文本内容;当检测到用户未对文本内容进行选中时,调用vscode.window.activeTextEditor.document.getText方法,获取文本内容,并将文本内容作为用户要执行的目标文本内容。
本发明实施例提供的装置,通过基于显示的文本内容,当检测到拓展程序启动时,获取用户要执行的目标文本内容。根据目标文本内容,向数据库服务器发送数据库命令行。获取数据库服务器的返回结果。在输出窗口中显示返回结果。由于可基于启动的拓展程序,根据打开的文本文件中显示的文本内容,,来执行对应的数据库命令,而不用复制或手动键入数据库命令,从而节省了数据库命令执行时的命令输入时间,进而提高了数据库命令的执行效率。
另外,由于在预设文本编辑器中可打开多个文本文件,当用户需要执行大量数据库命令时,可将数据库命令拆分成多个文本文件,通过打开多个文本文件分别执行对应的数据库命令,从而能够便于用户对数据库命令的执行流程进行管理。
最后,由于在执行数据库命令时,可通过检测到的预设连接地址,自动连接对应的数据库服务器,从而进一步地提高了数据库命令的执行效率。
实施例四
图6是示出本申请实施例四的一种操作数据库的设备的结构框图。
参照图6,所述一种操作数据库的设备,包括:处理器 (processor)601、存储器(memory)602和总线603;
其中,处理器601及存储器602通过所述总线603完成相互间的通信;
所述处理器601用于调用所述存储器602中的程序指令,以执行上述各方法实施例所提供的方法,例如包括:基于显示的文本内容,当检测到拓展程序启动时,获取用户要执行的目标文本内容,显示的文本内容至少包含数据库命令行;根据所述目标文本内容,向数据库服务器发送数据库命令行;获取所述数据库服务器的返回结果;在输出窗口中显示所述返回结果。
实施例五
本实施例公开一种计算机程序产品,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,计算机能够执行上述各方法实施例所提供的方法,例如包括:基于显示的文本内容,当检测到拓展程序启动时,获取用户要执行的目标文本内容,显示的文本内容至少包含数据库命令行;根据所述目标文本内容,向数据库服务器发送数据库命令行;获取所述数据库服务器的返回结果;在输出窗口中显示所述返回结果。
实施例六
本实施例提供一种非暂态计算机可读存储介质,所述非暂态计算机可读存储介质存储计算机指令,所述计算机指令使所述计算机执行上述各方法实施例所提供的方法,例如包括:基于显示的文本内容,当检测到拓展程序启动时,获取用户要执行的目标文本内容,显示的文本内容至少包含数据库命令行;根据所述目标文本内容,向数据库服务器发送数据库命令行;获取所述数据库服务器的返回结果;在输出窗口中显示所述返回结果。
本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储于一计算机可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。
以上所描述的一种操作数据库的设备等实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性的劳动的情况下,即可以理解并实施。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到各实施方式可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件。基于这样的理解,上述技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行各个实施例或者实施例的某些部分所述的方法。
最后,本申请的方法仅为较佳的实施方案,并非用于限定本发明的保护范围。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。

Claims (13)

  1. 一种操作数据库的方法,其特征在于,包括:
    基于显示的文本内容,当检测到拓展程序启动时,获取用户要执行的目标文本内容,显示的文本内容至少包含数据库命令行;
    根据所述目标文本内容,向数据库服务器发送数据库命令行;
    获取所述数据库服务器的返回结果;
    在输出窗口中显示所述返回结果。
  2. 根据权利要求1所述的方法,其特征在于,所述获取用户要执行的目标文本内容之前,还包括:
    检测用户对文本文件的打开指令;
    当检测到打开指令时,通过所述预设文本编辑器,显示用户打开的目标文本文件中的文本内容。
  3. 根据权利要求1所述的方法,其特征在于,所述获取用户要执行的目标文本内容,包括:
    检测用户对所述文本内容的选中指令;
    当检测到选中指令时,根据所述选中指令所对应的文本选中范围,获取用户要执行的目标文本内容。
  4. 根据权利要求1所述的方法,其特征在于,所述根据所述目标文本内容,向数据库服务器发送数据库命令行之前,还包括:
    创建数据库客户端实例;
    通过所述数据库客户端实例,连接数据库服务器。
  5. 根据权利要求4所述的方法,其特征在于,所述通过所述数据库客户端实例,连接数据库服务器,包括:
    获取所述文本内容中的预设连接地址;
    通过所述数据库客户端实例,连接所述预设连接地址对应的数据库服务器。
  6. 根据权利要求5所述的方法,其特征在于,所述获取所述文本内容中的预设连接地址,包括:
    对所述文本内容中的每一行内容进行检测;
    当在任一行内容中检测到第一预设字符时,获取所述任一行内容中所述第一预设字符后面的字符串,将所述字符串作为预设连接地址。
  7. 根据权利要求1所述的方法,其特征在于,所述根据所述目标文本内容,向数据库服务器发送数据库命令行,包括:
    根据所述目标文本内容中的第二预设字符,将所述目标文本内容拆分成数据库命令行集合;
    基于所述数据库命令行集合,向所述数据库服务器发送数据库命令及参数。
  8. 根据权利要求1所述的方法,其特征在于,所述在输出窗口中显示所述返回结果,包括:
    向所述输出窗口写入所述返回结果;
    通过调用输出窗口实例的显示方法,在所述输出窗口中显示所述返回结果。
  9. 根据权利要求1或2所述的方法,其特征在于,所述预设文本编辑器为VS Code,所述数据库服务器为Redis服务器,所述获取用户要执行的目标文本内容,包括:
    调用vscode.window.activeTextEditor.selection.isEmpty接口,检测用户是否对所述文本内容进行选中;
    基于所述接口返回的数值,当检测到用户对所述文本内容进行选中时,以vscode.window.activeTextEditor.selection为参数,调用vscode.window.activeTextEditor.document.getText方法获取用户要执行的目标文本内容;
    当检测到用户未对所述文本内容进行选中时,调用vscode.window.activeTextEditor.document.getText方法,获取所述文本内容,并将所述文本内容作为用户要执行的目标文本内容。
  10. 一种操作数据库的装置,其特征在于,所述装置包括:
    第一获取模块,用于基于显示的文本内容,当检测到拓展程序启动时,获取用户要执行的目标文本内容,显示的文本内容至少包含数据库命令行;
    发送模块,用于根据所述目标文本内容,向数据库服务器发送数据库命令行;
    第二获取模块,用于获取所述数据库服务器的返回结果;
    第一显示模块,用于在输出窗口中显示所述返回结果。
  11. 一种操作数据库的设备,其特征在于,包括:
    至少一个处理器;以及
    与所述处理器通信连接的至少一个存储器,其中:
    所述存储器存储有可被所述处理器执行的程序指令,所述处理器调用所述程序指令能够执行如权利要求1至9任一所述的方法。
  12. 一种计算机程序产品,其特征在于,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使所述计算机执行如权利要求1至9任一所述的方法。
  13. 一种非暂态计算机可读存储介质,其特征在于,所述非暂态计算机可读存储介质存储计算机指令,所述计算机指令使所述计算机执行如权利要求1至9任一所述的方法。
PCT/CN2017/076038 2016-12-09 2017-03-09 一种操作数据库的方法及装置 WO2018103223A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN2016111314162 2016-12-09
CN201611131416.2A CN106815010B (zh) 2016-12-09 2016-12-09 一种操作数据库的方法及装置

Publications (1)

Publication Number Publication Date
WO2018103223A1 true WO2018103223A1 (zh) 2018-06-14

Family

ID=59107080

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/076038 WO2018103223A1 (zh) 2016-12-09 2017-03-09 一种操作数据库的方法及装置

Country Status (2)

Country Link
CN (1) CN106815010B (zh)
WO (1) WO2018103223A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109635041A (zh) * 2018-12-04 2019-04-16 山东中创软件商用中间件股份有限公司 基于Sqoop工具的数据传输方法、装置、设备及介质
CN111857752A (zh) * 2020-07-22 2020-10-30 浪潮商用机器有限公司 一种PostgreSQL数据库安装方法、装置及设备
CN112765914A (zh) * 2021-01-22 2021-05-07 上海华虹宏力半导体制造有限公司 在版图设计窗口下自动选择设计层的方法及系统

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030233385A1 (en) * 2002-06-12 2003-12-18 Bladelogic,Inc. Method and system for executing and undoing distributed server change operations
CN103064960A (zh) * 2012-12-31 2013-04-24 华为技术有限公司 数据库查询方法及设备
CN105488081A (zh) * 2014-10-13 2016-04-13 镇江鼎拓科技信息有限公司 一种基于asp技术的数据库连接方法
CN105677916A (zh) * 2016-03-02 2016-06-15 浪潮软件集团有限公司 一种关于Redis使用的方法
CN105956160A (zh) * 2016-05-17 2016-09-21 武汉邮电科学研究院 一种Android应用访问数据库的方法

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101227323A (zh) * 2008-01-15 2008-07-23 中兴通讯股份有限公司 实现界面配置和命令行配置同步操作数据的方法及系统
US20100162201A1 (en) * 2008-12-18 2010-06-24 Sap Ag Automated multi-platform configuration tool for master data management systems using secure shell protocol
US9330148B2 (en) * 2011-06-30 2016-05-03 International Business Machines Corporation Adapting data quality rules based upon user application requirements

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030233385A1 (en) * 2002-06-12 2003-12-18 Bladelogic,Inc. Method and system for executing and undoing distributed server change operations
CN103064960A (zh) * 2012-12-31 2013-04-24 华为技术有限公司 数据库查询方法及设备
CN105488081A (zh) * 2014-10-13 2016-04-13 镇江鼎拓科技信息有限公司 一种基于asp技术的数据库连接方法
CN105677916A (zh) * 2016-03-02 2016-06-15 浪潮软件集团有限公司 一种关于Redis使用的方法
CN105956160A (zh) * 2016-05-17 2016-09-21 武汉邮电科学研究院 一种Android应用访问数据库的方法

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109635041A (zh) * 2018-12-04 2019-04-16 山东中创软件商用中间件股份有限公司 基于Sqoop工具的数据传输方法、装置、设备及介质
CN111857752A (zh) * 2020-07-22 2020-10-30 浪潮商用机器有限公司 一种PostgreSQL数据库安装方法、装置及设备
CN111857752B (zh) * 2020-07-22 2023-08-08 浪潮商用机器有限公司 一种PostgreSQL数据库安装方法、装置及设备
CN112765914A (zh) * 2021-01-22 2021-05-07 上海华虹宏力半导体制造有限公司 在版图设计窗口下自动选择设计层的方法及系统

Also Published As

Publication number Publication date
CN106815010B (zh) 2021-01-01
CN106815010A (zh) 2017-06-09

Similar Documents

Publication Publication Date Title
US11099816B2 (en) Workflow development system with ease-of-use features
US8984339B2 (en) System and method for test case generation using components
KR101323011B1 (ko) 데이터베이스 애플리케이션에 선택 가능 기능 컨트롤을디스플레이하기 위한 명령 사용자 인터페이스
US7676785B2 (en) Hosted application as a designer in an integrated development environment
US9081899B2 (en) System and method for processing web service test cases
US8984340B2 (en) System and method for test case generation using action keywords
WO2021184725A1 (zh) 用户界面测试方法、装置、存储介质及计算机设备
US10353560B2 (en) Debugging a flow
US20110072424A1 (en) System for creating virtual application, method for installing virtual application, method for calling native api and method for executing virtual application
CN108762743B (zh) 一种数据表操作代码生成方法及装置
US8381104B2 (en) Systems and methods for providing context recognition
US20160239509A1 (en) File explorer system usable in an emulated integrated development environment (ide)
KR20060050489A (ko) 디맨드 이벤트를 위한 오브젝트 복제
US10437779B2 (en) Intelligent interactive screen capture
US8302070B2 (en) Output styling in an IDE console
CN111400244A (zh) 资源批量处理的方法及装置、电子设备和存储介质
WO2018103223A1 (zh) 一种操作数据库的方法及装置
EP2951678B1 (en) Remotely executing operations of an application using a schema that provides for executable scripts in a nodal hierarchy
US10372760B2 (en) Building queries directed to objects hosted on clouds
US11036478B2 (en) Automated determination of transformation objects
US20180129593A1 (en) Cross-platform api test flow synthesizer
US20230161945A1 (en) Automatic two-way generation and synchronization of notebook and pipeline
WO2018040439A1 (zh) 文档的处理方法及装置
Millar et al. Developing a Scalpel and Foremost Graphical User Interface
JP2023075925A (ja) ノートブックおよびパイプラインの自動的な双方向の生成および同期化

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17877742

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17877742

Country of ref document: EP

Kind code of ref document: A1