Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
DorianGray committed Aug 27, 2015
1 parent 888e1a5 commit 4680163
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package = "lusty-store-mysql"
version = "0.3-2"
version = "0.3-3"
source = {
url = "https://github.com/Olivine-Labs/lusty-store-mysql/archive/v0.3.tar.gz",
dir = "lusty-store-mysql-0.3"
Expand Down
20 changes: 0 additions & 20 deletions lusty-store-mysql/store/mysql/delete.lua
Original file line number Diff line number Diff line change
@@ -1,24 +1,6 @@
local query = require 'lusty-store-mysql.query'
local connection = require 'lusty-store-mysql.store.mysql.connection'

local function keysAndValues(tbl)
local n, keys, values = 1, {}, {}
for k, v in pairs(tbl) do
keys[n] = k
values[n] = v
n = n + 1
end
return keys, values
end

local function makeUpdate(tbl)
local n, update = 1, {}
for k, v in pairs(tbl) do
update[n] = k..'='..ngx.quote_sql_str(v)
end
return table.concat(update, ' ,')
end

return {
handler = function(context)
local db, err = connection(lusty, config)
Expand All @@ -29,8 +11,6 @@ return {
else
q = context.query
end
local keys, values = keysAndValues(context.data)
local update = makeUpdate(context.data)
q = "DELETE FROM "..config.collection.." WHERE "..q..";"
local results = {}
local res, err, errno, sqlstate = db:query(q)
Expand Down

0 comments on commit 4680163

Please sign in to comment.