shahryarjb
hello,
I have a challenge which I should do it. I need multi values in my db with Ecto, but I need to pass it like one request
please see my image :
for example when my user calls my router link , I should pass this :
- count all records of category one
- load and count all records of the category one which its version_id = 1 along with its fields
- lists of all version along with its title and id
Do I send 3 Repo.all to my db with Ecto or something else?
I want to create like this : EasyBlog - Changelog for 6.0.18
My client only sends Category Id and I should pass like this Json example :
Category_id == 1
[
category_info: [
count_all_records: 100,
count_all_records_by_version_one: 10
load_list_of_version: [
{
name: "1.5",
id: 1
},
{
name: "1.7",
id: 2
},
{
name: "1.6",
id: 3
},
{
name: "3",
id: 4
}
]
]
category_records: [
{
name: "bug fix 1",
id: 1
version_id: 1
},
{
name: "bug fix 2",
id: 3
version_id: 3
},
{
name: "bug fix 3",
id: 10
version_id: 3
},
]
]
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
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
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
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
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
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 new to elixir and just tried to install the elixirLS extension for VScode(ium) and it is throwing some errors that I would like help ...
New
Other Trending Topics
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
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
Hi everyone!
The first release candidate for the Expert language server project is now available!
We’ve published a press release detai...
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
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
- #ai
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #elixirconf-eu
- #metaprogramming
- #hex











Showing Posts 1 to 6- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
peerreynders
This part doesn’t make any sense.
versionholds “zero or more” versions for any onecategory. Soversion.id = 1would belong to exactly onecategory.min(version.id)(or more likelymax(version.id)for the specified singlecategory.shahryarjb
unfortunately I didn’t understand what you said, I’m sorry.
version.titleis a string field andversion_idrelationed with record table, In fact, this is a filter, if it doesn’t answer me, so what do I do? I’m confused.I just need to get table records which relation with
Versiontable in the Category concerned( category id = 2) . how can I do? I’m new to this field , I sorry and thank you for giving me your time.shahryarjb
Ok , hmm, now I know it , but what is your suggestion? but I think it isn’t only problem , my main problem is how to write query for this , even if this logic is wrong.I’m confused.

So, I am thinking my way may be right, because at first, I print all Version of category which relation, and my user selects each one and sends it.
My
version_idis aUUID, for this purpose, I want to print all versions of category with other query. if my client didn’t send anyversion_id, I would selectmax(version_title)of category which relation it.Is my idea correct?
peerreynders
This is the organization that makes sense to me:
shahryarjb
At first, I am very grateful to you.
it seems that I need to use Query 2, it works with normal ID like integer, but I am using UUID, or I have to use normal ID or I should find the way which I will be able to fix it.
Your Post and codes are the best practice for me, Thank you.
Edited
I edited like this :
Versionsfunction is true, butcountsfunction which has a problem shows me this :Edit 2
I edited again :
The previous problem was solved but …
peerreynders
It seems that PostgreSQL can’t compare UUIDs directly but only use them in JOINS. Try this version: