Registry / database / gimlet

gimlet

JSON →
library0.5.2jsnpmunverified

Gimlet is a Node.js module that provides a lightweight database access layer on top of common drivers like MySQL. It adds high-level validations, helper methods (create, remove, queryRow, queryOne), and Record instances with change tracking, saving, and freezing capabilities. As of v2.1.0, it is actively maintained with gradual updates. Unlike ORMs/ODMs, developers write raw SQL queries. Dependencies: mysql driver must be installed separately.

npm install gimlet
INSTALL
IMPORT
SIG · GIMLET
G
gimlet
databasejavascriptv0.5.2
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

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

default
import gimlet from 'gimlet'
const gimlet = require('gimlet')
ESM requires Node >=16 or type: module. CJS require still works.
Gimlet
import Gimlet from 'gimlet'
import { Gimlet } from 'gimlet'
Default export is the constructor/object.
types
import { types } from 'gimlet'
import types from 'gimlet/types'
Named export for Point/Polygon types.

Connect to MySQL, query users, modify a record, and save changes.

import gimlet from 'gimlet'; import mysql from 'mysql'; // must install separately const connection = gimlet.connect('mysql://user:pass@localhost/db'); const handler = connection.handler(); handler.query('SELECT * FROM users', (err, users) => { if (err) throw err; console.log(users[0] instanceof gimlet.Record); // true console.log(users[0].name); users[0].name = 'Updated'; users[0].save(err => console.log('saved')); });
Debug
Known issues
gotchagimlet.connect() does not immediately connect for MySQL; first query triggers connection.
fix
Call connection.open(cb) if you need immediate connection check.
affects: >=1.0.0
deprecatedgimlet types Point/Polygon constructor may change in future; prefer plain objects if possible.
fix
Use driver-specific POINT handling if stability is critical.
affects: >=2.0.0
gotchaRecord.save() will fail if connection is closed or pool drained.
fix
Ensure connection is open before calling save, or handle errors.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'gimlet'
Package not installed or missing from node_modules
fix
npm install gimlet
Error: connect ECONNREFUSED
MySQL server not running or incorrect host/port
fix
Start MySQL or verify connection string: mysql://user:pass@localhost:3306/db
Upgrade
Version history
0.5.2latest on npm
Audit
Dependencies
mysqlrequiredRequired for MySQL driver support
Agent activity
6 hits · last 30 days
node
6
Resources