The purpose of this plugin is to connect with mysql database and perform query.
Project description
Mysql Connector
This plugin connects to Mysql and executes a SQL query.
Configuration
Example
{
"source": {
"name": "mysql",
"id": "a8430a5c-43de-44eb-9c25-2b1426aed3a0"
},
"type": "select",
"query": "SELECT * FROM user WHERE User=%s;",
"data": [
"root"
],
"timeout": 10
}
- source this a resource with MySQL credentials. See below for credentials schema.
- type - type of query, possible values are ['select', 'insert', 'delete', 'update']
- query - this is the SQL prepared statement. It will replace %s with data provided in data key. This is a sequential order so order of %s and data matters.
- data - data to replace in SQL prepared statement template.
- timeout - query timeout.
Output
It returns the data in JSON.
Example
{
"result": [
{
"Host": "%",
"User": "root",
"Select_priv": "Y",
"Insert_priv": "Y",
"Update_priv": "Y",
"Delete_priv": "Y",
"Create_priv": "Y",
"Drop_priv": "Y"
},
{
"Host": "localhost",
"User": "root",
"Select_priv": "Y",
"Insert_priv": "Y",
"Update_priv": "Y",
"Delete_priv": "Y",
"Create_priv": "Y",
"Drop_priv": "Y"
}
]
}
If the query is of insert type then the output result will have last inserted record id.
If the query is of type "delete","update", or "create" then the output result will have input payload.
Errors
Not all arguments converted during string formatting
This error is raised when the number of %s placeholders and data do not match. That means the number of placeholders is not equal to the number of data.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for tracardi-mysql-connector-0.6.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59935fdf2fb87a6565c49502ef7fdb460331e79b0b5cb623a2e492874737fc73 |
|
MD5 | 5a2dfde2002b020c4bf086d388f7f628 |
|
BLAKE2b-256 | 8093e834aae705c12c05052e16c7cd17ee6d9b3d72e8f59fdc6ee7cda345bdf5 |
Close
Hashes for tracardi_mysql_connector-0.6.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c78d73a37a61ed65998e4796a8bc6f64b1e569c2acbace7dc7c67785dd74306 |
|
MD5 | 384da854eadce4e59d6a1db66ba21efd |
|
BLAKE2b-256 | 4f5268c32a4b219ca2ec74d2ac86d98653a0a1ac32151aa5a47e0206253ba138 |