@tractorzoom/serverless-mysql-utils
    TypeScript icon, indicating that this package has built-in type declarations

    4.4.24 • Public • Published

    @tractorzoom/serverless-mysql-utils

    Wrapper around serverless-mysql implementing standardized error handling and automatic retries

    Commitizen friendly jest Prettier Renovate enabled semantic-release

    pull_request_verify publish

    Available Methods

    Method: executeQuery(queryString)
    parameter type description
    query string sql query string to be executed

    How do I use? 🤔

    Installation:
    npm i @tractorzoom/serverless-mysql-utils
    Usage:

    The following environment variables must be set or a config object must be passed as a second arg to executeQuery to make the connection with mysql:

    variable type description
    database string mame of the database to use for this connection
    host string the hostname of the database you are connecting to
    user string the mysql user to authenticate as
    password string the password of that mysql user
    import dbConfig from './config';
    import { executeQuery } from '@tractorzoom/serverless-mysql-utils';
    
    export const getItems = async () => {
        const queryString = `SELECT * FROM MyTable WHERE id = "some-guid"`;
    
        const response = await executeQuery(queryString, dbConfig);
    
        if (response.error) {
            return [];
        }
    
        return response;
    };

    Install

    npm i @tractorzoom/serverless-mysql-utils

    DownloadsWeekly Downloads

    1,084

    Version

    4.4.24

    License

    MIT

    Unpacked Size

    35.1 kB

    Total Files

    39

    Last publish

    Collaborators

    • tractorzoom