Comparing version 4.0.2 to 5.0.0
@@ -0,1 +1,6 @@ | ||
### v5.0.0 | ||
- Upgrade to latest `sqlite` & `mysql` package versions | ||
- Upgrade to `pg` 7.x. ORM will not work with `pg` < 7 | ||
- Drop support for nodejs < 4 (required due to `pg` upgrade) | ||
### v4.0.2 | ||
@@ -2,0 +7,0 @@ - Fix timezone bug in sqlite ([822](../../pull/822)] |
@@ -10,3 +10,3 @@ { | ||
"nodemon": "0.7.10", | ||
"moment": "2.4.0", | ||
"moment": "2.21.0", | ||
"pg": "2.6.2", | ||
@@ -13,0 +13,0 @@ "colors": "0.6.2" |
@@ -12,3 +12,3 @@ var _ = require("lodash"); | ||
connect: function (cb) { | ||
this.db.connect(this.config, function (err, client, done) { | ||
this.db.connect(function (err, client, done) { | ||
if (!err) { | ||
@@ -24,3 +24,3 @@ done(); | ||
} | ||
this.db.connect(this.config, function (err, client, done) { | ||
this.db.connect(function (err, client, done) { | ||
if (err) { | ||
@@ -41,7 +41,2 @@ return cb(err); | ||
return this; | ||
}, | ||
on: function(ev, cb) { | ||
// Because `pg` is the same for all instances of this driver | ||
// we can't keep adding listeners since they are never removed. | ||
return this; | ||
} | ||
@@ -65,8 +60,2 @@ }, | ||
return this; | ||
}, | ||
on: function(ev, cb) { | ||
if (ev == "error") { | ||
this.db.on("error", cb); | ||
} | ||
return this; | ||
} | ||
@@ -105,3 +94,3 @@ } | ||
functions = switchableFunctions.pool; | ||
this.db = pg; | ||
this.db = new pg.Pool(this.config); | ||
} else { | ||
@@ -127,2 +116,9 @@ this.db = new pg.Client(this.config); | ||
Driver.prototype.on = function(ev, cb) { | ||
if (ev == "error") { | ||
this.db.on("error", cb); | ||
} | ||
return this; | ||
}; | ||
Driver.prototype.ping = function (cb) { | ||
@@ -129,0 +125,0 @@ this.execSimpleQuery("SELECT * FROM pg_stat_activity LIMIT 1", function () { |
@@ -55,3 +55,3 @@ var _ = require("lodash"); | ||
var connect = function (opts, cb) { | ||
exports.connect = function (opts, cb) { | ||
if (arguments.length === 0 || !opts || !optsChecker(opts)) { | ||
@@ -140,2 +140,4 @@ cb = typeof(cb) !== 'function' ? opts : cb; | ||
exports.connectAsync = Promise.promisify(exports.connect, { context: exports }); | ||
var use = function (connection, proto, opts, cb) { | ||
@@ -176,8 +178,2 @@ if (DriverAliases[proto]) { | ||
/** | ||
* | ||
* @param opts | ||
*/ | ||
exports.connectAsync = Promise.promisify(connect); | ||
exports.addAdapter = adapters.add; | ||
@@ -468,3 +464,1 @@ | ||
} | ||
exports.connect = connect; |
@@ -15,3 +15,3 @@ { | ||
], | ||
"version": "4.0.2", | ||
"version": "5.0.0", | ||
"license": "MIT", | ||
@@ -61,13 +61,12 @@ "homepage": "http://dresende.github.io/node-orm2", | ||
"engines": { | ||
"node": "*" | ||
"node": ">= 4.0.0" | ||
}, | ||
"analyse": false, | ||
"dependencies": { | ||
"async": "2.5.0", | ||
"bluebird": "^3.5.0", | ||
"async": "2.6.1", | ||
"bluebird": "3.5.1", | ||
"enforce": "0.1.7", | ||
"hat": "0.0.3", | ||
"lodash": "4.17.4", | ||
"lodash": "4.17.10", | ||
"path-is-absolute": "1.0.1", | ||
"sinon": "^3.2.1", | ||
"sql-ddl-sync": "0.3.13", | ||
@@ -77,13 +76,14 @@ "sql-query": "0.1.26" | ||
"devDependencies": { | ||
"chalk": "2.0.1", | ||
"chalk": "2.4.1", | ||
"glob": "7.1.2", | ||
"mocha": "3.4.2", | ||
"mocha": "5.2.0", | ||
"mongodb": "1.4.10", | ||
"mysql": "2.13.0", | ||
"pg": "6.4.1", | ||
"semver": "5.3.0", | ||
"should": "11.2.1", | ||
"sqlite3": "3.1.8" | ||
"mysql": "2.15.0", | ||
"pg": "7.4.3", | ||
"semver": "5.5.0", | ||
"should": "13.2.1", | ||
"sinon": "6.0.0", | ||
"sqlite3": "4.0.0" | ||
}, | ||
"optionalDependencies": {} | ||
} |
@@ -9,2 +9,9 @@ ## Object Relational Mapping | ||
## This package is not actively maintained | ||
If you're starting a new project, please consider using one of the following instead as they have a much more active community: | ||
* https://github.com/bookshelf/bookshelf | ||
* https://github.com/sequelize/sequelize | ||
## Install | ||
@@ -18,3 +25,3 @@ | ||
Supported: 0.12 - 6.0 + | ||
Supported: 4.0 + | ||
@@ -140,7 +147,7 @@ Tests are run on [Travis CI](https://travis-ci.org/) | ||
}; | ||
orm.connectAsync(opts) | ||
.then(function(db) { | ||
.then(function(db) { | ||
// connected | ||
// ... | ||
// ... | ||
}) | ||
@@ -324,6 +331,6 @@ .catch(function() { | ||
// SQL: "SELECT * FROM person WHERE surname = 'Doe'" | ||
console.log("People found: %d", people.length); | ||
console.log("First person: %s, age %d", people[0].fullName(), people[0].age); | ||
people[0].age = 16; | ||
@@ -345,3 +352,3 @@ return people[0].saveAsync(); | ||
var [min, max] = result; // you should use destructuring here | ||
console.log(min, max); | ||
@@ -1159,2 +1166,2 @@ }); | ||
## License | ||
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fdresende%2Fnode-orm2.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fdresende%2Fnode-orm2?ref=badge_large) | ||
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fdresende%2Fnode-orm2.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fdresende%2Fnode-orm2?ref=badge_large) |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8
1162
270187
10
6175
+ Addedasync@2.6.1(transitive)
+ Addedbluebird@3.5.1(transitive)
+ Addedlodash@4.17.10(transitive)
- Removedsinon@^3.2.1
- Removed@colors/colors@1.6.0(transitive)
- Removed@dabh/diagnostics@2.0.3(transitive)
- Removed@sinonjs/commons@1.8.6(transitive)
- Removed@sinonjs/formatio@3.2.2(transitive)
- Removed@sinonjs/samsam@3.3.3(transitive)
- Removed@sinonjs/text-encoding@0.7.3(transitive)
- Removed@types/triple-beam@1.3.5(transitive)
- Removedarray-from@2.1.1(transitive)
- Removedasync@2.5.03.2.6(transitive)
- Removedbluebird@3.7.2(transitive)
- Removedbuild@0.1.4(transitive)
- Removedcolor@3.2.1(transitive)
- Removedcolor-convert@1.9.3(transitive)
- Removedcolor-name@1.1.3(transitive)
- Removedcolor-string@1.9.1(transitive)
- Removedcolorspace@1.1.4(transitive)
- Removedcssmin@0.3.2(transitive)
- Removeddiff@3.5.0(transitive)
- Removedenabled@2.0.0(transitive)
- Removedfecha@4.2.3(transitive)
- Removedfn.name@1.1.0(transitive)
- Removedformatio@1.2.0(transitive)
- Removedinherits@2.0.4(transitive)
- Removedis-arrayish@0.3.2(transitive)
- Removedis-stream@2.0.1(transitive)
- Removedisarray@0.0.1(transitive)
- Removedjs-yaml@0.3.7(transitive)
- Removedjsmin@1.0.1(transitive)
- Removedjust-extend@4.2.1(transitive)
- RemovedjxLoader@0.1.1(transitive)
- Removedkuler@2.0.0(transitive)
- Removedlodash@4.17.21(transitive)
- Removedlodash.get@4.4.2(transitive)
- Removedlogform@2.7.0(transitive)
- Removedlolex@2.7.55.1.2(transitive)
- Removedmakeerror@1.0.12(transitive)
- Removedmoo-server@1.3.0(transitive)
- Removedms@2.1.3(transitive)
- Removednative-promise-only@0.8.1(transitive)
- Removednise@1.5.3(transitive)
- Removedone-time@1.0.0(transitive)
- Removedpath-to-regexp@1.9.0(transitive)
- Removedpromised-io@0.3.6(transitive)
- Removedreadable-stream@3.6.2(transitive)
- Removedsafe-buffer@5.2.1(transitive)
- Removedsafe-stable-stringify@2.5.0(transitive)
- Removedsamsam@1.3.0(transitive)
- Removedsimple-swizzle@0.2.2(transitive)
- Removedsinon@3.3.0(transitive)
- Removedstack-trace@0.0.10(transitive)
- Removedstring_decoder@1.3.0(transitive)
- Removedtext-encoding@0.6.4(transitive)
- Removedtext-hex@1.0.0(transitive)
- Removedtimespan@2.3.0(transitive)
- Removedtmpl@1.0.5(transitive)
- Removedtriple-beam@1.4.1(transitive)
- Removedtype-detect@4.0.84.1.0(transitive)
- Removeduglify-js@1.3.5(transitive)
- Removedutil-deprecate@1.0.2(transitive)
- Removedwalker@1.0.8(transitive)
- Removedwinston@3.17.0(transitive)
- Removedwinston-transport@4.9.0(transitive)
- Removedwrench@1.3.9(transitive)
Updatedasync@2.6.1
Updatedbluebird@3.5.1
Updatedlodash@4.17.10