-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adds remaining defdelgate to required functions #45
- Loading branch information
1 parent
33f3102
commit 94808f3
Showing
2 changed files
with
55 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,52 @@ | ||
defmodule Alog.Connection do | ||
alias Ecto.Adapters.Postgres.Connection, as: EAPC | ||
|
||
@behaviour Ecto.Adapters.SQL.Connection | ||
@default_port 5432 | ||
|
||
@impl true | ||
def child_spec(opts) do | ||
opts | ||
|> Keyword.put_new(:port, @default_port) | ||
|> Postgrex.child_spec() | ||
end | ||
|
||
@impl true | ||
defdelegate ddl_logs(result), to: EAPC | ||
|
||
@impl true | ||
defdelegate prepare_execute(conn, name, statement, params, opts), to: EAPC | ||
|
||
@impl true | ||
defdelegate query(conn, statement, params, opts), to: EAPC | ||
|
||
@impl true | ||
defdelegate stream(conn, statement, params, opts), to: EAPC | ||
|
||
@impl true | ||
defdelegate to_constraints(error_struct), to: EAPC | ||
|
||
@impl true | ||
defdelegate execute(conn, query, params, opts), to: EAPC | ||
|
||
@impl true | ||
defdelegate all(query), to: EAPC | ||
|
||
@impl true | ||
defdelegate update_all(query, prefix \\ nil), to: EAPC | ||
|
||
@impl true | ||
defdelegate delete_all(query), to: EAPC | ||
|
||
@impl true | ||
defdelegate ddl_logs(result), to: Ecto.Adapter.Postgres | ||
defdelegate insert(prefix, table, header, rows, on_conflict, returning), to: EAPC | ||
|
||
@impl true | ||
defdelegate prepare_execute(connection, name, statement, params, options), | ||
to: Ecto.Adapter.Postgres | ||
defdelegate update(prefix, table, fields, filters, returning), to: EAPC | ||
|
||
@impl true | ||
defdelegate query(connection, statement, params, options), to: Ecto.Adapter.Postgres | ||
defdelegate delete(prefix, table, filters, returning), to: EAPC | ||
|
||
@impl true | ||
defdelegate stream(connection, statement, params, options), to: Ecto.Adapter.Postgres | ||
defdelegate execute_ddl(arg), to: EAPC | ||
end |