Registry / database / rhinozug

rhinozug

JSON →
library1.1.6jsnpmunverified

A database connection and migration module from Rhinogram, designed as an internal tool to be used alongside rhinozug-CLI. It wraps Knex.js with MySQL and PostgreSQL support, providing a configured Knex connection object for projects. Version 1.1.6 is the latest stable release; no public release cadence is indicated. Its key differentiator is tight integration with Rhinogram's migration tooling.

npm install rhinozug
INSTALL
IMPORT
SIG · RHINOZUG
R
rhinozug
databasejavascriptv1.1.6
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.

default
✓ import rhinozug from 'rhinozug'
✗ const rhinozug = require('rhinozug')
This package is ESM-only; CommonJS require will fail. Use dynamic import if necessary.
connect
✓ import { connect } from 'rhinozug'
✗ import { connection } from 'rhinozug'
Named export is 'connect', not 'connection'.
Knex
✓ import type { Knex } from 'knex'
✗ import { Knex } from 'rhinozug'
Knex type is imported directly from 'knex', not from 'rhinozug'.

Shows how to import, configure, and use rhinozug to obtain a typed Knex connection using MySQL.

import rhinozug from 'rhinozug'; import { Knex } from 'knex'; const config = { client: 'mysql', connection: { host: process.env.DB_HOST ?? 'localhost', user: process.env.DB_USER ?? 'user', password: process.env.DB_PASS ?? 'password', database: process.env.DB_NAME ?? 'mydb' } }; const db: Knex = rhinozug(config); // Use db as a regular Knex instance const result = await db('users').select('*'); console.log(result);
Debug
Known issues
breakingPackage is ESM-only since v1.0; using require() will throw a runtime error.
fix
Use import syntax or dynamic import: const rhinozug = await import('rhinozug')
affects: >=1.0
gotchaThe package returns a Knex instance; do not call new Knex() separately.
fix
Use the returned object directly as a Knex connection.
affects: >=0.0
gotchaThe config object must include a 'client' field set to 'mysql' or 'pg'.
fix
Ensure config.client is 'mysql' or 'pg' (case-sensitive).
affects: >=0.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module not supported
Using CommonJS require() for an ESM-only package.
fix
Switch to import syntax or use dynamic import: const rhinozug = await import('rhinozug')
Error: Knex: require is not defined
Missing Knex dependency or incorrect peer dependency.
fix
Install knex as a dependency: npm install knex
Error: Client 'mysql' is not a valid Knex client
Missing MySQL driver package.
fix
Install mysql: npm install mysql
Upgrade
Version history
1.1.6latest on npm
Audit
Dependencies
knexrequiredCore dependency; Rhinozug returns a Knex connection object.
mysqloptionalMySQL driver for database connections when using MySQL.
pgoptionalPostgreSQL driver for database connections when using PostgreSQL.
Agent activity
13 hits · last 30 days
node
12
Meta
1
Resources
rhinozug — npm install rhinozug · libregistry