mysql-emulator
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

GitHub license npm version GitHub Workflow Status (with branch) npm downloads

MySQL Emulator

The package emulates a MySQL database from within Node.js, specifically designed for e2e testing.

Try it out at the playground.

⚠ The library is still under active development. It means that some features are not working and may be considered as invalid syntax or ignored.

⚠ Known limitations:

  • No right join
  • Default order might differ (always use ORDER BY when the order matters)
  • Column names might differ, f.e. count(u.id) => COUNT(`u`.`id`) (aliases fix it)
  • No timezone support

📃 TODO

  • [ ] ALTER statement (in most cases ALTER even is not needed, synchronize will do all the work)
  • [x] Foreign key constraints
  • [ ] Fill INFORMATION_SCHEMA tables
  • [x] DELETE ORDER BY field LIMIT number
  • [x] UPDATE ORDER BY field LIMIT number
  • [x] SELECT GROUP BY position/alias
  • [x] SELECT ORDER BY position/alias
  • [ ] Implement the most used functions

Usage

Just start from:

npm install mysql-emulator

Then it's ready to go:

import { query } from 'mysql-emulator';

await query(...);

Examples

Package Sidebar

Install

npm i mysql-emulator

Weekly Downloads

17

Version

0.1.0

License

MIT

Unpacked Size

269 kB

Total Files

165

Last publish

Collaborators

  • ivan.nosov