Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport: Fix typespec rows as lists not tuples #259

Open
wants to merge 1 commit into
base: v0.8
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions lib/mariaex/structs.ex
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ defmodule Mariaex.Result do
* `command` - An atom of the query command, for example: `:select` or
`:insert`;
* `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}
Expand Down