Skip to content

Instantly share code, notes, and snippets.

@developerworks
Created March 7, 2015 14:45
Show Gist options
  • Select an option

  • Save developerworks/f69a68def1f8dd40cd46 to your computer and use it in GitHub Desktop.

Select an option

Save developerworks/f69a68def1f8dd40cd46 to your computer and use it in GitHub Desktop.
defmodule UserSystem.Repo do
use Ecto.Repo, adapter: Ecto.Adapters.MySQL
# Connection options
#
#:hostname - Server hostname;
#:port - Server port (default: 3306);
#:username - Username;
#:password - User password;
#:parameters - Keyword list of connection parameters;
#:ssl - Set to true if ssl should be used (default: false);
#:ssl_opts - A list of ssl options, see ssl docs;
#:connect_timeout - The timeout for establishing new connections, defaults to 5000
@doc """
The conf/0 function defines the details Ecto needs to connect to the database.
Of course, we need to fill in our own actual values for username, password, host, and database_name
"""
def conf do
parse_url "ecto://root:root@localhost/usersystem"
end
@doc """
The priv/0 function defines the directory into which Ecto will create a migrations directory for our migration files.
We'll talk more about migrations in just a moment.
"""
def priv do
app_dir(:user_system, "priv/repo")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment