glen
Is there a way to change the default database instance from Postgres to Mariadb or Mysql for ecto? I am aware of the option to use the database flag, but since I have years more experience with mysql, I’d love to make it the default.
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hello,
I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself.
My main conc...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 9- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
John-Goff
I do not believe that there is any kind of config file or anything that you could set to make your choice of database the default. I think that generally the generators are only used once when creating a project, so I’m not sure that adding such an option would be all that beneficial. If you are in fact creating new Phoenix projects on the regular you could always create a bash script which passes the flags you would like.
wmnnd
Take a look at the docs for
mix phx.new: mix phx.new — Phoenix v1.8.8You can simply specify the
--database mysqloption when creating a new Phoenix project.kokolegorille
You can always make some kind of shell alias if You really want to avoid typing –database mysql.
But You cannot change default value of phx.new
OvermindDL1
You could, however, fork it and make your own version to change the default and install your fork locally. ^.^
Seems like it would be a pretty minimal patchset to keep in sync. Maybe even PR it looking in a config in
$XDG_CONFIG_HOMEsomewhere for what default config options for it to set (don’t forget to log to user that it found a config file at a given location and is using it for defaults so it’s not silently surprising).kokolegorille
Yes, forking is a possibility
glen
Yes, but I think I’m too much of an Elixir virgin and not ready to fork…
I am at the stage where I am running several tutorials and wondering whether I am better off biting the bullet and using Postgres for now or figure out how to modify the scripts that call mix setup or phx.new to make it use MySQL.
It’s mainly the Postgres shell that makes me slow and unhappy. Maybe I’ll try a gui for Postgres and see if that works around the issue.
Thanks for your feedback, all.
kokolegorille
I would recommend to use postgresql if You want to follow tutorials, because there are some differences with mysql. Almost all tutorials I saw use it.
like ordering, or search case sensitivity, or extensions (citext, postgis etc).
I have often used mysql with Rails, but once I had to use windows functions. I don’t know if it is supported by mysql now, but 5 years ago it was not.
It’s always possible to switch later.
John-Goff
I would recommend using postgres, I started with MySQL and while it worked fine, there was a subset of ecto features that I wanted to use which required using postgres. Though switching from mysql to postgres was relatively painless all things considered, so if you do decide to go with one and then change your mind it should be doable. But yeah I wouldn’t bother modifying the script for phx.new, just use the --database flag or like I said earlier, wrap it in a bash script.
glen
In case it’s of interest, in the last 2 or 3 years windowed functions and other features like virtual columns have received significant upgrades on Mariadb and MySQL, with little functionality missing compared to MSSQL for example. Although Mariadb is usually ahead of the curve.