Closed alexdesousa closed 4 years ago
This PR fixes a bug that prevented running functions by name e.g. given the following file included in the module Myapp.Server:
Myapp.Server
-- file: lib/servers.sql -- name: get -- docs: Gets servers. SELECT hostname, ip_address FROM servers :_where -- name: by_hostname WHERE hostname = :hostname
The following call would produce an error:
iex(1)> Myapp.Server.get(_where: :by_hostname, hostname: "my_server") {:error, ...}
while the query should be equivalent to the following:
iex(2)> Myapp.Server.get(_where: &Myapp.Server.by_hostname/2, hostname: "my_server") {:ok, [...]}
This PR fixes a bug that prevented running functions by name e.g. given the following file included in the module
Myapp.Server
:The following call would produce an error:
while the query should be equivalent to the following: