MySQL

This is an adapter for MySQL databases.

For MySQL adapter we user knex under the hood.

Good to know: Before running the example make sure you have installed minimum Nodejs 14, npm 6, and have created a simple express application.

// config.{ts|js}
import { MySQL } from 'crud-node';

// Connection configuration object
export const connection = {
  host: 'localhost',
  port: 3306,
  schema: 'db',
  password: 'user',
  user: 'user',
  timezone: '+00:00',
};

export const settings = {
  ciCollation: 'utf8mb4_0900_ai_ci',
};

export const db = new MySQL(connection, settings);
await db.connect();

Last updated