From fd50d8eae3baf8a7346ab091c0d2842e6c35bf45 Mon Sep 17 00:00:00 2001 From: Mike Buhot Date: Thu, 30 Aug 2018 11:15:57 +1000 Subject: [PATCH] Fix typespec and README for rows as lists not tuples Looks like it was changed from tuples to lists in 0.4 --- README.md | 2 +- lib/mariaex/structs.ex | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b6d112d..59e9c19 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ After you are done, run `mix deps.get` in your shell to fetch and compile Mariae iex(5)> Mariaex.query(p, "SELECT id, title FROM test1") {:ok, %Mariaex.Result{columns: ["id", "title"], command: :select, num_rows: 2, - rows: [{1, "test"}, {2, "test2"}]}} + rows: [[1, "test"], [2, "test2"]}} ``` ## Configuration diff --git a/lib/mariaex/structs.ex b/lib/mariaex/structs.ex index 6527d85..d7fe510 100644 --- a/lib/mariaex/structs.ex +++ b/lib/mariaex/structs.ex @@ -3,14 +3,14 @@ defmodule Mariaex.Result do Result struct returned from any successful query. Its fields are: * `columns` - The column names; - * `rows` - The result set. A list of tuples, each tuple corresponding to a - row, each element in the tuple corresponds to a column; + * `rows` - The result set. A list of lists, each list corresponding to a + row, each element of the inner list corresponds to a column value; * `num_rows` - The number of fetched or affected rows; """ @type t :: %__MODULE__{ columns: [String.t] | nil, - rows: [tuple] | nil, + rows: [[any]] | nil, last_insert_id: integer, num_rows: integer, connection_id: nil}