-
-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: upgrade gh runner * remove psql from tests
- Loading branch information
Showing
7 changed files
with
147 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.0.5 | ||
1.0.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
defmodule SingleConnection do | ||
alias Postgrex, as: P | ||
@behaviour P.SimpleConnection | ||
|
||
def connect(conf) do | ||
P.SimpleConnection.start_link(__MODULE__, [], conf) | ||
end | ||
|
||
@impl true | ||
def init(_args) do | ||
{:ok, %{from: nil}} | ||
end | ||
|
||
@impl true | ||
def handle_call({:query, query}, from, state) do | ||
{:query, query, %{state | from: from}} | ||
end | ||
|
||
def handle_result(results, state) when is_list(results) do | ||
IO.inspect({213, results}) | ||
P.SimpleConnection.reply(state.from, results) | ||
{:noreply, state} | ||
end | ||
|
||
@impl true | ||
def handle_result(%Postgrex.Error{} = error, state) do | ||
IO.inspect({213, error}) | ||
P.SimpleConnection.reply(state.from, error) | ||
{:noreply, state} | ||
end | ||
|
||
@impl true | ||
def notify(_, _, _), do: :ok | ||
end |