-
Notifications
You must be signed in to change notification settings - Fork 84
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
Script - No connection to insert data #171
Comments
Neither your App, nor its dependencies get started when in test env, so you have to do it yourself. In your testhelper it should be sufficient to add `Application.ensure_started(:mariaex). I do not know this library though but have come because of your post on the elixirforum: https://elixirforum.com/t/problem-script-creation/3602 |
unsuccessfully. |
I took a closer look. There is no mariaex.testhelper in this application. Have you created it on your own? If not it can't work... |
In fact, I took as an example to create my own script. Steps I've taken Def deps 2 - After "mix.deps.get" I did not do anything else. I'm new to Elixir |
|
Would you have any such scripts? For example. |
A TestHelper you mean? It should have been generated when running |
Thank you very much for your help. |
I am currently creating a .exs script,
To communicate with Mysql.
The following script below.
ExUnit.start
defmodule PreparedQueryTest do
use ExUnit.Case, async: true
import Mariaex.TestHelper
setup do
{:ok, p} = Mariaex.Connection.start_link(username: "user", password: "password", database: "elixir_1", hostname: "192.168.10.90")
Mariaex.query(p, "INSERT INTO elixir_1.formulario VALUES('value1', 'value2', 'value3', 'value4');")
end
end
Error:
(CompileError) PROJECT_1/myapp/test/home.exs:13: module Mariaex.TestHelper is not loaded and could not be found
How to solve?
Note: The shell works perfectly the command {:ok, p} = Mariaex.Connection.start_link(username: "user", password: "password", database: "elixir_1", hostname: "192.168.10.90")
The text was updated successfully, but these errors were encountered: