MySQL Shell API 8.4.3
Unified development interface for MySQL Products
|
Encloses the functions and classes available to interact with an X Protocol enabled MySQL Product. More...
Classes | |
class | Type |
Constants to represent data types of Column objects. More... | |
class | LockContention |
Constants to represent lock contention types. More... | |
Functions | |
Session | getSession (ConnectionData connectionData, String password) |
Creates a Session instance using the provided connection data. More... | |
Expression | expr (String expressionStr) |
Creates an Expression object based on a string. More... | |
Date | dateValue (Integer year, Integer month, Integer day, Integer hour, Integer minutes, Integer seconds, Integer milliseconds) |
Creates a Date object which represents a date time. More... | |
Encloses the functions and classes available to interact with an X Protocol enabled MySQL Product.
The objects contained on this module provide a full API to interact with the different MySQL Products implementing the X Protocol.
In the case of a MySQL Server the API will enable doing operations on the different database objects such as schema management operations and both table and collection management and CRUD operations. (CRUD: Create, Read, Update, Delete).
Intention of the module is to provide a full API for development through scripting languages such as JavaScript and Python, this would be normally achieved through a normal session.
To use the properties and functions available on this module you first need to import it.
When running the shell in interactive mode, this module is automatically imported.
Session getSession | ( | ConnectionData | connectionData, |
String | password | ||
) |
Creates a Session instance using the provided connection data.
connectionData | The connection data for the session |
password | Optional password for the session |
A Session object uses the X Protocol to allow executing operations on the connected MySQL Server.
The connection data may be specified in the following formats:
A basic URI string has the following format:
[scheme://][user[:password]@]<host[:port]|socket>[/schema][?option=value&option=value...]
Connection Options
The following options are valid for use either in a URI or in a dictionary:
When these options are defined in a URI, their values must be URL encoded.
The following options are also valid when a dictionary is used:
Base Connection Options
SSH Tunnel Connection Options
The connection options are case insensitive and can only be defined once.
If an option is defined more than once, an error will be generated.
Detailed description of the connection data format is available at Connection Data
Expression expr | ( | String | expressionStr | ) |
Creates an Expression object based on a string.
expressionStr | The expression to be represented by the object |
An expression object is required in many operations on the X DevAPI.
Some applications of the expression objects include:
Date dateValue | ( | Integer | year, |
Integer | month, | ||
Integer | day, | ||
Integer | hour, | ||
Integer | minutes, | ||
Integer | seconds, | ||
Integer | milliseconds | ||
) |
Creates a Date object which represents a date time.
year | The year to be used in the new Date object. |
month | The month to be used in the new Date object. |
day | The month to be used in the new Date object. |
hour | Optional hour to be used in the new Date object. |
minutes | Optional minutes to be used in the new Date object. |
seconds | Optional seconds to be used in the new Date object. |
milliseconds | Optional milliseconds to be used in the new Date object. |
This function creates a Date object containing: