
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
@axway/api-builder-plugin-dc-mysql
Advanced tools
MySQL plugin
The MySQL data connector is a plugin for API Builder that can connect to your MySQL database instance and interrogate your schema that will automatically provision Models into to your project, and optionally, automatically generate a rich CRUD API to the underlying tables. The Models can be used programmatically, or can be used within the flow editor to interact with your database.
npm install --no-optional @axway/api-builder-plugin-dc-mysql
A configuration file is generated for you and placed into the conf directory of your API Builder project. By default, we use a host of localhost, and expect user and password to come from the OS host environment.
Once the plugin is installed, the configuration file is located <project>/conf/mysql.default.js.
| Option name | Type | Description |
|---|---|---|
| connector | string | Must be: @axway/api-builder-plugin-dc-mysql |
| connectionPooling | boolean | boolean Enables connection pooling for better performance and scalability. |
| connectionLimit | number | Number of simultaneous connections when connectionPooling is enabled. |
| host | string | The database host. |
| port | number | The database post. |
| database | string | The database instance name. |
| user | string | The user with which to connect to the database. |
| password | string | The user's password with which to connect to the database. |
| generateModelsFromSchema | boolean | If enabled, API Builder will automatically interrogate the database and auto-generate Models from SQL tables. |
| modelAutogen | boolean | If enabled, API Builder will automatically generate a full and rich CRUD API from the generated Models. |
The mysql library used by this connector depends on a MySQL server setting NO_BACKSLASH_ESCAPES to mitigate against SQL injection attacks. This setting must be disabled (which is the default setting for MySQL servers).
After you configure the connector, you can start up your API Builder project and visit the console (normally found under http://localhost:8080/console). Your connector will be listed under the Connectors section of the console.
Your database tables will be listed under the Models section of the console. You can now click on the gear icon to the right of the table names and generate flow based APIs.
You can also reference the connector in a custom model.
const Account = APIBuilder.Model.extend('Account', {
fields: {
Name: { type: String, required: true }
},
connector: 'mysql'
});
If you want to map a specific model to a specific table, use metadata. For example, to map the account model to the table named accounts, set it such as:
const Account = APIBuilder.Model.extend('account', {
fields: {
Name: { type: String, required: false, validator: /[a-zA-Z]{3,}/ }
},
connector: 'mysql',
metadata: {
'mysql': {
table: 'accounts'
}
}
});
engines.apibuilder.conf directory does not exist.@axway/api-builder-project-utils to handle copying config to a project after installing this plugin.create.#4871: Breaking Change: Introduce support $eq, $in and $nin (IN and NOT IN) operators in where query.
Previously, when using Model flow-nodes and the auto-generated APIs with the MySQL data connectors, it was not possible to formulate a where clause to return results where the field value is in or not in a list of values. Now the where clause can use $eq, $in and $nin to construct these queries, e.g. { "field": { "$in": ["value1", "value2",...]}}.
For more information on the Model flow-node and the methods that accept a where clause please see the Model documentation.
Previously, the MySql data connector returned undefined when query returned no results. Now, it returns an empty array.
This code is proprietary, closed source software licensed to you by Axway. All Rights Reserved. You may not modify Axway’s code without express written permission of Axway. You are licensed to use and distribute your services developed with the use of this software and dependencies, including distributing reasonable and appropriate portions of the Axway code and dependencies. Except as set forth above, this code MUST not be copied or otherwise redistributed without express written permission of Axway. This module is licensed as part of the Axway Platform and governed under the terms of the Axway license agreement (General Conditions) located here: https://support.axway.com/en/auth/general-conditions; EXCEPT THAT IF YOU RECEIVED A FREE SUBSCRIPTION, LICENSE, OR SUPPORT SUBSCRIPTION FOR THIS CODE, NOTWITHSTANDING THE LANGUAGE OF THE GENERAL CONDITIONS, AXWAY HEREBY DISCLAIMS ALL SUPPORT AND MAINTENANCE OBLIGATIONS, AS WELL AS ALL EXPRESS AND IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO IMPLIED INFRINGEMENT WARRANTIES, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, AND YOU ACCEPT THE PRODUCT AS-IS AND WITH ALL FAULTS, SOLELY AT YOUR OWN RISK. Your right to use this software is strictly limited to the term (if any) of the license or subscription originally granted to you.
FAQs
MySQL plugin
The npm package @axway/api-builder-plugin-dc-mysql receives a total of 5 weekly downloads. As such, @axway/api-builder-plugin-dc-mysql popularity was classified as not popular.
We found that @axway/api-builder-plugin-dc-mysql demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 19 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.