Registry / database / gulp-etl-mysql-adapter

gulp-etl-mysql-adapter

JSON →
library1.0.7jsnpmunverified

A vinyl adapter for gulp-etl that extracts data from MySQL databases using the mysql2 driver and produces Message Stream JSON Lines compliant with the Singer specification. Version 1.0.7 is the current stable release; the project is in maintenance mode with no recent commits. Unlike typical gulp plugins, this is a vinyl adapter that acts as a tap (source) for database records. It uses the mysql2 library for async queries and supports the gulp-data API for dynamic configuration. A dest (target) function is planned but not yet implemented.

npm install gulp-etl-mysql-adapter
INSTALL
IMPORT
SIG · GULP-ETL-MYSQL-ADA
G
gulp-etl-mysql-adapter
databasejavascriptv1.0.7
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.

src
const mysqlAdapter = require('gulp-etl-mysql-adapter'); // Then call mysqlAdapter.src('pretend.jsonl', config)
import { src } from 'gulp-etl-mysql-adapter';
Package does not ship ES modules; use CommonJS require. The module exports a function that returns an object with .src().
default export
const mysqlAdapter = require('gulp-etl-mysql-adapter');
const { default: mysqlAdapter } = require('gulp-etl-mysql-adapter');
No default export exists; the module exports a single constructor function.
TypeScript types
import mysqlAdapter = require('gulp-etl-mysql-adapter');
import mysqlAdapter from 'gulp-etl-mysql-adapter';
Package includes TypeScript declarations. Use import = require() syntax for correct types in TS with CommonJS.

Demonstrates extracting data from MySQL using mysqlAdapter.src(), converting to CSV via gulp-etl-target-csv, and writing to disk.

const gulp = require('gulp'); const mysqlAdapter = require('gulp-etl-mysql-adapter'); const targetCsv = require('gulp-etl-target-csv').targetCsv; const config = { buffer: false, sql: 'SELECT * FROM customers LIMIT 2;', connection: { host: process.env.MYSQL_HOST ?? 'localhost', user: process.env.MYSQL_USER ?? 'root', password: process.env.MYSQL_PASSWORD ?? '', database: process.env.MYSQL_DATABASE ?? 'mydb' } }; gulp.task('extract-mysql', function() { return mysqlAdapter.src('mysqlData.jsonl', config) .pipe(targetCsv()) .pipe(gulp.dest('./output')); });
Debug
Known issues
deprecatedNo dest() function implemented; only src() is available.
fix
Use src() only. For writing to databases, consider combining with other gulp-etl targets like target-csv or target-json.
affects: <=1.0.7
gotchaThe 'glob' parameter for src() is a pretend filename, not an actual file glob. Misuse may cause confusion.
fix
Pass any string (e.g., 'output.jsonl') as the first argument; it becomes the virtual file name in the stream.
affects: *
breakingRequires Node.js 10 or higher due to mysql2 dependency.
fix
Upgrade Node.js to version 10+.
affects: >=1.0.0
gotchaConfig object must include 'sql' and 'connection' properties; missing them causes runtime errors.
fix
Ensure config has both 'sql' (string) and 'connection' (object with host, user, password, database).
affects: *
Errors
Common errors & fixes
Error: Cannot find module 'gulp-etl-mysql-adapter'
Package not installed in node_modules.
fix
Run 'npm install gulp-etl-mysql-adapter'
TypeError: mysqlAdapter.src is not a function
Incorrect import; the module exports a function, not an object with src.
fix
Use: const mysqlAdapter = require('gulp-etl-mysql-adapter'); then mysqlAdapter.src(...)
Error: Cannot read property 'query' of undefined
Connection configuration is missing or invalid.
fix
Verify the connection object has host, user, password, database.
Upgrade
Version history
1.0.7latest on npm
Audit
Dependencies
mysql2requiredCore MySQL database driver used for all queries
Agent activity
6 hits · last 30 days
node
6
Resources
gulp-etl-mysql-adapter — npm install gulp-etl-mysql-adapter · libregistry