Socket
Socket
Sign inDemoInstall

tedious-async

Package Overview
Dependencies
55
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    tedious-async

https://github.com/SyedNaqiRizvi/tedious-async.git


Version published
Weekly downloads
314
decreased by-13.26%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Tedious Async

An ES6 Typescript async/await wrapper around the tedious library.

Details

This package includes several extension functions that can be used with async/await as well as all other original tedious functinoality. As a utility, all query extension functions return SQL data as JSON with column name as field name and the column value as field value.

Additional Details:

  • Last updated: May 31, 2019
  • Dependencies: tedious

Installation

npm install --save tedious-async

Usage

onConnect

Here is an example of how you can use the onConnect implementation asynchronously. Origin implementation for reference: https://tediousjs.github.io/tedious/api-connection.html#event_connect

import { Connection, ConnectionConfig } from 'tedious-async';
const config: ConnectionConfig = {
    // Tedious configurations
};

const dbConnection = async(config: ConnectionConfig):  => {
    const connection = new Connection(config);
    try {
        const onConnectResult = await connection.onConnect();
        return connection;
    } catch (error) {
        throw error;
    }
};

execSqlAsync

Here is an example of how you can use the execSqlAsync. Origin synchronous implementation: https://tediousjs.github.io/tedious/api-connection.html#function_execSql

const getAllUsers = async() => {
    const users = await execSqlAsync("select * from owners;");
    return users;
};

Keywords

FAQs

Last updated on 02 Jun 2019

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc