Closed rodesousa closed 3 months ago
Hi @rodesousa :wave:
I missed that part. Thanks for letting me know!
@rodesousa kindly check this PR #30. Let me know if this fixes your issue.
Setting the credentials dynamically won't work since the Connection
module by default is a struct (hence, compile time).
This also affects the test files of the library, since it relies on explicit connection string. Leaving it blank will throw an error.
To reproduce:
test
env: MIX_ENV=test iex -S mix
Application.put_all_env(
ex_typesense: [
api_key: "xyz",
host: "localhost",
port: 8108,
scheme: "http"
]
)
ExTypesense.Connection.new
Connection
struct field values returns nil
.Since the problem came from making the connection a struct, it defeats the purpose of making it dynamic (runtime). So we have to change it from struct to map.
@jaeyson It works ! :)
elixir version: 1.15.4 ex_typesense version: 0.4
I configure ex typesense into runtime.exs. But when I run test all of data from ExTypesense.Connection.new is nil I put the configuration into test.exs but no effect