Modules@robinpath/mysql

@robinpath/mysql

0.1.1Public

MySQL/MariaDB client with connection pooling, parameterized queries, transactions, and CRUD operations

@robinpath/mysql

MySQL/MariaDB client with connection pooling, parameterized queries, transactions, and CRUD operations

Category Functions Auth License

Why use this module?

The mysql module lets you:

  • Execute SQL query
  • Insert a row
  • Insert multiple rows
  • Update rows
  • Delete rows

All functions are callable directly from RobinPath scripts with a simple, consistent API.

Installation

npm install @robinpath/mysql

Quick Start

1. Set up credentials

mysql.connect {"host": "localhost", "user": "root", "database": "mydb"}

2. Execute SQL query

mysql.query "SELECT * FROM users WHERE id = ?" [1]

Available Functions

FunctionDescription
mysql.connectConnect to MySQL database
mysql.queryExecute SQL query
mysql.insertInsert a row
mysql.insertManyInsert multiple rows
mysql.updateUpdate rows
mysql.removeDelete rows
mysql.transactionExecute queries in transaction
mysql.tablesList all tables
mysql.describeDescribe table structure
mysql.countCount rows
mysql.closeClose connection pool
mysql.closeAllClose all connection pools

Examples

Execute SQL query

mysql.query "SELECT * FROM users WHERE id = ?" [1]

Insert a row

mysql.insert "users" {"name": "Alice", "email": "alice@example.com"}

Insert multiple rows

mysql.insertMany "users" [{"name": "Alice"}, {"name": "Bob"}]

Integration with RobinPath

import { RobinPath } from "@wiredwp/robinpath";
import Module from "@robinpath/mysql";

const rp = new RobinPath();
rp.registerModule(Module.name, Module.functions);
rp.registerModuleMeta(Module.name, Module.functionMetadata);

const result = await rp.executeScript(`
  mysql.connect {"host": "localhost", "user": "root", "database": "mydb"}
  mysql.query "SELECT * FROM users WHERE id = ?" [1]
`);

Full API Reference

See MODULE.md for complete documentation including all parameters, return types, error handling, and advanced examples.

Related Modules

License

MIT

Versions (1)

VersionTagPublished
0.1.1latestyesterday
Install
$ robinpath install @robinpath/mysql
Version0.1.1
LicenseMIT
Unpacked Size5.1 KB
Versions1
Weekly Downloads0
Total Downloads0
Stars0
Last Publishyesterday
Createdyesterday

Category

data