sqlite-express
Advanced tools
Comparing version 2.0.10 to 2.0.11
@@ -1,13 +0,10 @@ | ||
const signs = require('./submodules/signos'); | ||
const is = require('./submodules/is'); | ||
const whereConstructor = require('./submodules/where'); | ||
const procecedRows = require('./submodules/procecedRows'); | ||
module.exports = async (db, table, col, where, conect) => { | ||
return await new Promise((resolve, reject) => { | ||
console.log(`SELECT ${col} FROM ${table} ${whereConstructor.query(where, conect)}`); | ||
db.all(`SELECT ${col} FROM ${table} ${whereConstructor.query(where, conect)}`, whereConstructor.placeHolders(where), function(err, rows) { | ||
if (err) {reject(err);} | ||
else {resolve(rows);} | ||
if(err){reject(err);}else{resolve(rows);}; | ||
}); | ||
}); | ||
}; |
@@ -21,3 +21,3 @@ const select = require('./select'); | ||
originalData.forEach(row=>{ | ||
arrCase.push(`WHEN ROWID = ${row.rowid} THEN ?`); | ||
arrCase.push(`WHEN ROWID = ${Object.keys(row)[0]} THEN ?`); | ||
arrDataInsert.push(strngifyData(dataInsert(parseData(row[upCol])))); | ||
@@ -33,4 +33,4 @@ }) | ||
placeHolders = [...placeHolders, ...whereConstructor.placeHolders(where)]; | ||
console.log(`UPDATE ${table} SET ${upArray.join(', ')} ${whereConstructor.query(where, conect)}`) | ||
console.log(placeHolders); | ||
//console.log(`UPDATE ${table} SET ${upArray.join(', ')} ${whereConstructor.query(where, conect)}`) | ||
//console.log(placeHolders); | ||
db.run(`UPDATE ${table} SET ${upArray.join(', ')} ${whereConstructor.query(where, conect)}`, placeHolders, function(err) { | ||
@@ -37,0 +37,0 @@ if (err) { |
{ | ||
"name": "sqlite-express", | ||
"version": "2.0.10", | ||
"version": "2.0.11", | ||
"description": "functions for sqlite3", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -19,5 +19,2 @@ sqliteExpress = require('./index'); | ||
let hola = async()=>{ | ||
console.log(await sqliteExpress.select(ndb, 'noticias', '*', {nombre : 'pruebaMus'})) | ||
} | ||
hola() | ||
sqliteExpress.update(ndb, 'noticias', {publicada : (x)=>{return !x}}, {nombre : 'pruebaMus'}); |
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
40411
186