-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/copy-data-from-memory'
- Loading branch information
Showing
10 changed files
with
247 additions
and
302 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,9 @@ from MySQL to PostgreSQL as easy and smooth as possible.</p> | |
|
||
<h3>USAGE</h3> | ||
<p><b>1.</b> Create a new database.<br /> | ||
<b>Sample:</b> <code> CREATE DATABASE my_postgresql_database;</code></p> | ||
<b>Sample:</b> <code> CREATE DATABASE my_postgresql_database;</code><br /> | ||
If you are planning to migrate spatial data (geometry type columns), then <b>PostGIS</b> should be installed and enabled. | ||
</p> | ||
|
||
<p><b>2.</b> Download NMIG package and put it on the machine running your PostgreSQL (not mandatory, but preferably).<br /> | ||
<b>Sample:</b> <code>/path/to/nmig</code></p> | ||
|
@@ -61,7 +63,7 @@ from MySQL to PostgreSQL as easy and smooth as possible.</p> | |
<a href="mailto:[email protected]?subject=NMIG">[email protected]</a></p> | ||
|
||
<h3>VERSION</h3> | ||
<p>Current version is 3.0.0<br /> | ||
<p>Current version is 3.1.0<br /> | ||
(major version . improvements . bug fixes)</p> | ||
|
||
<h3>REMARKS</h3> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "nmig", | ||
"version": "3.0.0", | ||
"version": "3.1.0", | ||
"description": "The database migration app", | ||
"author": "Anatoly Khaytovich<[email protected]>", | ||
"license": "GPL-3.0", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,7 +62,7 @@ module.exports = self => { | |
+ '\n\t\\| \\/ /_|/______/' | ||
+ '\n\n\tNMIG - the database migration tool' | ||
+ '\n\tCopyright (C) 2016 - present, Anatoly Khaytovich <[email protected]>\n\n' | ||
+ '\t--[boot] Configuration has been just loaded.' | ||
+ '\t--[boot] Configuration has being just loaded.' | ||
+ message; | ||
|
||
console.log(logo); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/* | ||
* This file is a part of "NMIG" - the database migration tool. | ||
* | ||
* Copyright (C) 2016 - present, Anatoly Khaytovich <[email protected]> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program (please see the "LICENSE.md" file). | ||
* If not, see <http://www.gnu.org/licenses/gpl.txt>. | ||
* | ||
* @author Anatoly Khaytovich <[email protected]> | ||
*/ | ||
'use strict'; | ||
|
||
const { Readable } = require('stream'); | ||
|
||
module.exports = class BufferStream extends Readable { | ||
/** | ||
* BufferStream constructor. | ||
* | ||
* @param {Buffer} source | ||
*/ | ||
constructor(source) { | ||
super(); | ||
this._source = source; | ||
this._offset = 0; | ||
|
||
// When source buffer consumed entirely, then the 'end' event is emitted. | ||
this.on('end', this.destroy.bind(this)); | ||
} | ||
|
||
/** | ||
* BufferStream destructor. | ||
* | ||
* @returns {undefined} | ||
*/ | ||
destroy() { | ||
this._source = null; | ||
this._offset = null; | ||
} | ||
|
||
/** | ||
* Read chunks from the source buffer into the underlying stream buffer. | ||
* | ||
* @param {Number} size | ||
* | ||
* @returns {undefined} | ||
*/ | ||
_read(size) { | ||
// Push the next chunk onto the internal stream buffer. | ||
if (this._offset < this._source.length) { | ||
this.push(this._source.slice(this._offset, this._offset + size)); | ||
this._offset += size; | ||
return; | ||
} | ||
|
||
// When the source ends, then the EOF - signaling `null` chunk should be pushed. | ||
this.push(null); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.