1.0.1 • Published 3 years ago

@casper124578/mysql.ts v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

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

1.0.1

3 years ago

1.0.0

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.0

3 years ago

0.0.20

3 years ago

0.0.19

3 years ago

0.0.18

3 years ago

0.0.17

3 years ago

0.0.16

3 years ago

0.0.15

3 years ago

0.0.14

3 years ago

0.0.13

3 years ago

0.0.12

3 years ago

0.0.11

3 years ago

0.0.10

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago