You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
-
# gulp-etl-tap-mysql #
1
+
# gulp-etl-mysql-adapter #
2
2
3
-
This plugin connects to **MySQL** databases, running SQL queries and extracting the results to **gulp-etl****Message Stream** files. It is a **gulp-etl** wrapper for [mysql](https://www.npmjs.com/package/mysql).
3
+
This plugin connects to **MySQL** databases, running SQL queries and extracting the resulting rows to **gulp-etl****Message Stream** files. It is a **gulp-etl** wrapper for [mysql](https://www.npmjs.com/package/mysql).
4
4
5
5
This is a **[gulp-etl](https://gulpetl.com/)** tap, but unlike most of the other gulp-etl modules it is not a [gulp](https://gulpjs.com/) **[plugin](https://gulpjs.com/docs/en/getting-started/using-plugins)**; it is actually a **[vinyl adapter](https://gulpjs.com/docs/en/api/concepts#vinyl-adapters)**--it features a replacement for **[gulp.src()](https://gulpjs.com/docs/en/api/src)**. **gulp-etl** plugins and adapters work with [ndjson](http://ndjson.org/) data streams/files which we call **Message Streams** and which are compliant with the [Singer specification](https://github.com/singer-io/getting-started/blob/master/docs/SPEC.md#output). In the **gulp-etl** ecosystem, **taps** tap into an outside format or system (in this case, a MySQL database) and convert their contents/output to a Message Stream, and **targets** convert/output Message Streams to an outside format or system. In this way, these modules can be stacked to convert from one format or system to another, either directly or with tranformations or other parsing in between. Message Streams look like this:
6
6
@@ -16,7 +16,7 @@ This is a **[gulp-etl](https://gulpetl.com/)** tap, but unlike most of the other
16
16
### Usage
17
17
**gulp** adapters take two parameters: a glob, which is used to locate file(s) in the file system, and an optional config object with settings specific to the adapter. For example: ```src('*.txt', {buffer:false})```
18
18
19
-
Since this adapter doesn't pull from an existing file, the "glob" parameter is a virtual filename (with optional path info) which is assigned to the data file extracted from the server, e.g. ```mysqlData.ndjson```. And the configObj should look like this:
19
+
Since this adapter doesn't pull from an existing file, the "glob" parameter is a "pretend" filename (with optional path info) which is assigned to the data file extracted from the server, e.g. ```mysqlData.ndjson```. And the configObj should look like this:
20
20
##### configObj / mysql-settings.json
21
21
```
22
22
{
@@ -37,14 +37,14 @@ You *could* embed this information in your gulpfile, but we recommend storing it
37
37
/* Run select query on the server and save the results in a local CSV file */
38
38
39
39
var gulp = require('gulp')
40
-
var tapMysql = require('gulp-etl-tap-mysql')
40
+
var mysqlAdapter = require('gulp-etl-mysql-adapter')
41
41
var targetCsv = require('gulp-etl-target-csv').targetCsv
42
42
43
43
// contains secure info; store in parent folder of this project, outside of repo
44
44
let configObj = require('../../mysql-settings.json')
0 commit comments