lejoko
Hi,
I work for a small MVNO and I’m very much interested to try using Ash in our internal devs. However I have a (probably) breaking requirement : I need to be able to connect it to our MySQL 8.0 (Actually Percona XtraDB) cluster. Is there something in the making ? I heard about that in the past, but did not found anything up to now.
I might be interested in having a try at making a MySQL connector myself, but I’m not sure where should I start ?
Trending in Questions
I having some trouble figuring out if I have set myself too strict of standards for my production server. Currently I can handle 75% of r...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
Hello,
I’m trying to build a basic Phoenix web-app, and I’d like to use Tailwind.
However, when I launch mix phx.server, I get an error...
New
Hi everyone,
I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding.
I sta...
New
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
I’m working on a small exercise involving update_in/3, and I came up with this solution:
data = %{
name: "Periodic Table",
category:...
New
I’ve got trouble wrapping my head around the order in which functions are called in this snippet (from Phoenix’s authentication):
toke...
New
Other Trending Topics
Edit: 2026 May 15 - This post is archived.
Mob is alive!!
Main docs: mob v0.7.11 — Documentation
A bit of explanation for the slightly c...
New
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
Hi everyone!
The first release candidate for the Expert language server project is now available!
We’ve published a press release detai...
New
A little off-topic, but I feel like people here have a good head on their shoulders.
I used to be quite good at making software. Was luc...
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
- #ai
- #ecto-query
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #elixirconf-eu
- #api
- #forms
- #metaprogramming
- #hex











Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
zachdaniel
ash_sqliteintoash_mysqland start making modifications to get the tests passing. What will likely additionally need to happen is that theAshSqlimplementation will need to be expanded to account for whatever special thing isn’t supported bylejoko
Thanks for your answer. I started trying from a copy of ash_sqlite like you suggested and I’ve hit a problem that I’m not sure how to solve : 89 tests on 115 fail because :
What do you use it for ? Do you have an idea how may I work around that ?
zachdaniel
You can try removing it, we use it to get the result of the insert to return. It could be replaced with reading the inserted record again? Does SQLite return that info automatically perhaps?
lejoko
MySQL does not have a way to return the result of an insert. It returns only the number of inserted records.
If you rely on auto generated primary keys (
AUTO_INCREMENTin MySQL terms, which is the default for most people), there is a way to get it back wit a call to theLAST_INSERT_ID()function; You could then load the record back. However that would work only for an insert of a single record. For bulk inserts, that function returns only the id of the first inserted record, and there is no reliable way to get the ids of the other records (they might be guessable in simple cases, but it would break in a lot of clustering configs).The only way around that would be to generate the primary key on the app side and load the records afterward or to not rely on that ability…
zachdaniel
There is a fair amount of stuff in ash that depends on being able to get the results of a creation currently. So what we will have to do is add a capability for data layers, like
return_from_create, and then if they can’t do that, we’ll have to disable certain capabilities, likeafter_actionhooks.lejoko
For tables where the primary key is ecto generated (isn’t it the default in ash?), wouldn’t it be possible to “fake” the
:returningoption ?zachdaniel
Yes, we could definitely do that
They aren’t ecto generated, but they are generated in Ash by default. Basically requiring that all primary attributes have a
defaultconfigured could get us started. Then we could support auto incrementing integers later, but require that you can’t do certain things in create actions.lejoko
Soooo… As you suggested, I copied ash_sqlite and had a first try at an ash_mysql datalayer. It is far from finished : i have 35 failures on the 115 tests that came from ash_sqlite, and several hard coded parts that need to be properly finished/rewritten.
It’s available here : GitHub - ash-project/ash_mysql · GitHub
I’m having a bit of a hard time with it, since I’m an Ash rookie and in a lot of cases I’m not too sure of what would be the “right way” to do something. I’d be really happy if I could have some guiding to continue on that project because I really like Ash and would like to be able to use it at work!
zachdaniel
Nice! I will take a look in the next few days.
kamaroly
Super!