Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@casper124578/mysql.ts

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@casper124578/mysql.ts

A simple mysql wrapper for node.js

  • 1.0.1
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

mysql.ts

npm size license maintained

A simple node.js MySQL wrapper made with TypeScript.

Installation

npm

npm i @casper124578/mysql.ts

Yarn

yarn add @casper124578/mysql.ts

Usage

import { createConnection } from "@casper124578/mysql.ts";

async function init() {
  const connection = await createConnection({
    /* options */
    /* see: https://github.com/mysqljs/mysql#connection-options */
  });

  // query something
  const results = await connection.query().select(["id", "name"]).from("books").exec();

  console.log(results);
}

TypeScript support

interface MyData {
  id: string;
  fist_name: string;
  last_name: string;
}

const connection = await createConnection({
  /* ... */
});

const books = await connection
  .query<MyData>()
  // will have types!
  .select(["last_name", "fist_name"])
  .from("books")
  // will have types!
  .where("last_name", "hello")
  // will have types!
  .order("last_name", "ASC")
  .exec();

This is not a full list of methods. Check the docs for a full list!

Documentation

Checkout the documentation here

More

Example

You view check an example here

Keywords

FAQs

Package last updated on 02 Sep 2021

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc