Skip to content

Commit

Permalink
adding more complex scenarios for select where in
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Blowers committed Jul 13, 2017
1 parent ce61fe5 commit 9b3431b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/mssqlex/query_test.exs
Expand Up @@ -54,5 +54,15 @@ defmodule Mssqlex.QueryTest do
num_rows: 2,
rows: [["Dexter", 34], ["Malcolm", 41]]}} =
Mssqlex.query(pid, "SELECT * FROM query_test.dbo.select_where_in WHERE name IN (?, ?)", ["Dexter", "Malcolm"])

assert {:ok, _, %Result{columns: ["name", "age"],
num_rows: 1,
rows: [["Malcolm", 41]]}} =
Mssqlex.query(pid, "SELECT * FROM query_test.dbo.select_where_in WHERE (name IN (?, ?)) AND (age = ?)", ["Dexter", "Malcolm", 41])

assert {:ok, _, %Result{columns: ["name", "age"],
num_rows: 1,
rows: [["Dexter", 34]]}} =
Mssqlex.query(pid, "SELECT * FROM query_test.dbo.select_where_in WHERE (age = ?) AND (name IN (?, ?))", [34, "Dexter", "Malcolm"])
end
end

0 comments on commit 9b3431b

Please sign in to comment.