Skip to content

Commit

Permalink
Merge pull request #187 from Mashape/fix/reprepare-statements
Browse files Browse the repository at this point in the history
[feature] support unprepared statement errors. fix #11
  • Loading branch information
thibaultcha committed Apr 30, 2015
2 parents a047d56 + cdf94a0 commit 278edba
Show file tree
Hide file tree
Showing 8 changed files with 254 additions and 230 deletions.
12 changes: 6 additions & 6 deletions kong/dao/cassandra/apis.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,32 @@ function Apis:new(properties)
self._schema = SCHEMA
self._queries = {
insert = {
params = { "id", "name", "public_dns", "target_url", "created_at" },
args_keys = { "id", "name", "public_dns", "target_url", "created_at" },
query = [[ INSERT INTO apis(id, name, public_dns, target_url, created_at)
VALUES(?, ?, ?, ?, ?); ]]
},
update = {
params = { "name", "public_dns", "target_url", "id" },
args_keys = { "name", "public_dns", "target_url", "id" },
query = [[ UPDATE apis SET name = ?, public_dns = ?, target_url = ? WHERE id = ?; ]]
},
select = {
query = [[ SELECT * FROM apis %s; ]]
},
select_one = {
params = { "id" },
args_keys = { "id" },
query = [[ SELECT * FROM apis WHERE id = ?; ]]
},
delete = {
params = { "id" },
args_keys = { "id" },
query = [[ DELETE FROM apis WHERE id = ?; ]]
},
__unique = {
name = {
params = { "name" },
args_keys = { "name" },
query = [[ SELECT id FROM apis WHERE name = ?; ]]
},
public_dns = {
params = { "public_dns" },
args_keys = { "public_dns" },
query = [[ SELECT id FROM apis WHERE public_dns = ?; ]]
}
}
Expand Down
Loading

0 comments on commit 278edba

Please sign in to comment.