Registry / database / pawsh-mysql-db

pawsh-mysql-db

JSON →
library3.31.4-39jsnpmunverified

TypeScript library providing MySQL connection configuration and table name constants for the Pawsh pet grooming platform. Version 3.31.4-39 automatically reads environment variables to map logical table names (e.g., APPOINTMENTS_TABLE_NAME) to SQL table names (e.g., appointments). Ships built-in TypeScript types and exports a config object and all table name constants. Released daily; no competitors as it's internal to Pawsh.

npm install pawsh-mysql-db
INSTALL
IMPORT
SIG · PAWSH-MYSQL-DB
P
pawsh-mysql-db
databasejavascriptv3.31.4-39
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

config
import { config } from 'pawsh-mysql-db'
const config = require('pawsh-mysql-db')
ESM-only since v3
APPOINTMENTS_TABLE_NAME
import { APPOINTMENTS_TABLE_NAME } from 'pawsh-mysql-db'
Named export; use exact casing
config.getTableName
import { config } from 'pawsh-mysql-db'; config.getTableName('appointments')
config.getTableName('APPOINTMENTS_TABLE_NAME')
Accepts env var name or SQL table name

Shows how to import and use config and table name constants in TypeScript.

import { config, APPOINTMENTS_TABLE_NAME } from 'pawsh-mysql-db'; // Access the connection config console.log(config.host); // e.g., 'localhost' // Use a table name constant const sql = `SELECT * FROM ${APPOINTMENTS_TABLE_NAME}`; // Or get table name dynamically const table = config.getTableName('appointments'); console.log(table); // 'appointments'
Debug
Known issues
breakingconfig no longer returns a connection object; use mysql2 directly
fix
Create your own connection with mysql2 using config properties like host, user, password.
affects: >=3.0.0
deprecatedrequire() is deprecated; ESM-only import is required
fix
Use import statements instead of require.
affects: >=3.0.0
gotchaTable name constants export the raw env var value, not the SQL table name
fix
Use config.getTableName() to get the SQL table name from the env var.
affects: >=3.0.0
Errors
Common errors & fixes
TypeError: config.createConnection is not a function
config no longer has createConnection in v3
fix
Use mysql2.createConnection() with config properties.
ReferenceError: APPOINTMENTS_TABLE_NAME is not defined
Import missing or wrong casing
fix
Ensure import is correct: import { APPOINTMENTS_TABLE_NAME } from 'pawsh-mysql-db'
SyntaxError: Cannot use import statement outside a module
ESM import used in CJS project
fix
Add "type": "module" to package.json or use dynamic import.
Upgrade
Version history
3.31.4-39latest on npm
Audit
Dependencies
mysql2requiredUsed internally for MySQL connection
Agent activity
4 hits · last 30 days
node
4
Resources
pawsh-mysql-db — npm install pawsh-mysql-db · libregistry