Configuration in Livebook #1139
-
Hi 👋, I'm not very experienced with Mix and Livebook beyond basic usage so forgive me if this is a simple problem to solve. QuestionHow can configuration be added in live book, like ContextI'm finding Livebook is a great way to learn new libraries and concepts and I want to experiment with Ecto directly in Livebook. How would I achieve something like e.g. The config from Ecto - Getting Started import Config
config :friends, Friends.Repo,
database: "friends",
username: "user",
password: "pass",
hostname: "localhost" Is this possible to do config like this at runtime within in Livebook or does it need to happen when a livebook instance is run? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Mix.install/2 has a config option as second argument. So you can do:
But in the Ecto case, I just wouldn't use config. Instead I would pass they all as option on the |
Beta Was this translation helpful? Give feedback.
Mix.install/2 has a config option as second argument. So you can do:
But in the Ecto case, I just wouldn't use config. Instead I would pass they all as option on the
use Ecto.Repo
or onstart_link
.