Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mysql-activerecord

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mysql-activerecord - npm Package Compare versions

Comparing version 0.2.9 to 0.3.1

26

index.js

@@ -62,2 +62,6 @@ /**

connection.useDatabase(settings.database);
if (settings.charset) {
connection.query('SET NAMES ' + settings.charset);
}

@@ -96,6 +100,13 @@ var whereClause = {},

for (var key in dataSet) {
queryString += escapeFieldName(key) + "=" + connection.escape(dataSet[key]);
if (y < getObjectSize(dataSet)) {
queryString += separator;
y++;
if (dataSet.hasOwnProperty(key)) {
if (typeof dataSet[key] !== 'object') {
queryString += escapeFieldName(key) + "=" + connection.escape(dataSet[key]);
}
else if (typeof dataSet[key] === 'object' && dataSet[key] instanceof Array && dataSet[key].length > 0) {
queryString += escapeFieldName(key) + ' in ("' + dataSet[key].join('", "') + '")';
}
if (y < getObjectSize(dataSet)) {
queryString += separator;
y++;
}
}

@@ -152,8 +163,11 @@ }

this.where = function(whereSet, whereValue) {
if (typeof whereValue === 'undefined' && typeof whereSet === 'object') {
if (typeof whereSet === 'object' && typeof whereValue === 'undefined') {
whereClause = mergeObjects(whereClause, whereSet);
}
else if (typeof whereSet === 'string' || typeof whereSet === 'number') {
else if ((typeof whereSet === 'string' || typeof whereSet === 'number') && typeof whereValue != 'undefined') {
whereClause[whereSet] = whereValue;
}
else if ((typeof whereSet === 'string' || typeof whereSet === 'number') && typeof whereValue === 'object' && whereValue instanceof Array) {
whereClause[whereSet] = whereValue;
}
return that;

@@ -160,0 +174,0 @@ };

{ "name" : "mysql-activerecord"
, "version": "0.2.9"
, "version": "0.3.1"
, "devDependencies": {"node-mysql": "0.9.1"}
, "main" : "./"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc