Latest #ecto-query Threads 
I hope this is the right place to ask this. I’m ultimately using Phoenix, but the question itself is Ecto-specific.
I have two tables: o...
New
I want to model the following relationship:
A location has zero or one of multiple (currently 7) specifications (each specification is a...
New
I saw that Ecto repo have the function Repo.stream, but I dont know what the steps happens when a trigger the Stream.run. A query like SE...
New
Hello community.
I am trying to perform the following query in Ecto
SELECT *
FROM table t
where ARRAY[2, 12] <@ list_of_ids ;
The ...
New
I have two schemata Person and Book.
Both Book.author_id and Book.illustrator_id reference Person.id.
I want to load all books and prel...
New
When using postgres, I’d like to query a table where a JSONB column contains a JSON document with a field called members whose value is a...
New
What am I missing?
I am trying to ‘translate’ following SQL query to ecto:
SELECT g.groupname, g.id FROM groups AS g
LEFT OUTER JOIN un...
New
Hello there :slight_smile:
I have a schema A that has a one-to-many relationship with a schema B.
I want to make a query that lists all...
New
I have two schemas which look similar to the example below:
defmodule MyApp.Delivery do
use Ecto.Schema
schema "deliveries" do
...
New
I’m doing a fairly complex join where I want to preload an array of ContentMediaItems (called :contents) that are nested in an associatio...
New
This Week's Trending
This Month's Trending
This Year's Trending
Hello people!
I have a requirement to perform a select query with IN clause using tuples. I am using PostgreSQL. Example:
select * from...
New
Building off of this older post:
What I need to do is to create a few case-insensitive columns in PostGres. I’ve been following this po...
New
Hello community.
I am trying to perform the following query in Ecto
SELECT *
FROM table t
where ARRAY[2, 12] <@ list_of_ids ;
The ...
New
I hope this is the right place to ask this. I’m ultimately using Phoenix, but the question itself is Ecto-specific.
I have two tables: o...
New
I want to model the following relationship:
A location has zero or one of multiple (currently 7) specifications (each specification is a...
New
Last Three Year's Trending
How to convert following Ecto Query into the Plain RAW SQL
%Workspace{name: "#{prefix() || "public"}"} |> Repo.insert()
Your respons...
New
Hello, I have read the Ecto query and I see this line:
You should be very careful when allowing user sent data to be used as part of LIK...
New
Sorry for asking something that has been mentioned a few times here but would like some help to get a better understanding. What I’m tryi...
New
When using postgres, I’d like to query a table where a JSONB column contains a JSON document with a field called members whose value is a...
New
I couldn’t find an answer to this from searching so thought I would make a post about it.
I’m trying to get a list of Users who have not...
New
Sometimes, Ecto (actually, DBConnection) spills an error like this:
DBConnection.ConnectionError: ** (DBConnection.ConnectionError) conn...
New
I know not to worry about performance before getting evidence of a problem, but I’m idly curious about preloads. (Note: I have fairly lit...
New
Hello all :blush:
Disclaimer: Since this is a work thing, I changed the name of the schemas. The structure is the same.
I’m currently w...
New
Hello, I’m new to Phoenix and Ecto and having hard time making my own queries, hope you can help me with this one.
My situation is prett...
New
Hey
I want to introduce you a small utility that may help in writing dynamic queries :slight_smile:
In a few words, this code:
blank_s...
New
Hello Community, I have a question that I can’t figure out why Ecto query work this way.
So I have a next table:
...
New
Trying my hardest to reproduce this query with Ecto, but struggling:
SELECT DISTINCT("id"), sum("hits") AS hits
FROM "stats_daily"
WHERE...
New
I saw that Ecto repo have the function Repo.stream, but I dont know what the steps happens when a trigger the Stream.run. A query like SE...
New
I have a list like this
selected_fields = [:inbox_count, :phone_number_count, :comment_count, ...] #this list contains fields of a table...
New
I have tried this code:
def my_func(params) do
...
|> select(
[l],
%{
date: fragment("date_trunc('?',?)...
New
Trending Over Three Years
Hey I am returning a list of users from a function, and I want to use that list for a query.
how could I use the ids of those items for ...
New
Hello everyone, I was working on a project and was faced with this problem and I’d like some input from you on the subject. Imagine this ...
New
In short this was what I tried to do.
from(q in query,
join:
va in ^from(va in VideoAnalysis,
where: va.id == ^v...
New
Hello all,
I hope everyone is doing all right!
A very common task for me is to count the number of entries that match certain criterias...
New
I have a query like:
Alarms
|> preload(:event)
|> order_by([{:desc, :event[:id]}])
|> Repo.all()
You can see what I am tryi...
New
I have a slow query as my data has grown. I wanted to test joining before preloads to see if i could speed it up.
I did a test on some m...
New
I have once again nose-dived into the treeline while attempting to follow the official docs… I’m trying to stay positive here, but I am r...
New
my original syntax :
result =
Enum.map(
from(Repo, where: ^whitelisted_params)
|> where([schema], like(schema.nama, ^"#{nam...
New
Hi,
I’m new to Elixir. So sorry if I missed something.
I cannot make this query work:
alias Uniq.UUID
mandate_uuid = "6bf40047-117d-4...
New
Hi everybody,
Edit for TL;DR:
How I can use SQL array_agg aggregate function with an Ecto fragment.
Particularly how I can nest the se...
New
How can I write this query in Ecto?
SELECT
*,
(SELECT COUNT(o.id) FROM tenant_versilov.orders o
LEFT OUTER JOIN...
New
My data model is like this
Category has_many Products
Products belongs_to Category
Products belongs_to User
What I want from database...
New
Hello, first post here. Sorry I’m not good at explaining things.
I have a table of Buses, each of which is associated with one or more S...
New
I’m getting this error:
## ** (Ecto.Query.CompileError) Tuples can only be used in comparisons with literal tuples of the same size
fro...
New
:wave:
Relatively common setup:
I have a Thing which has_many SubThing. In the index view (showing many Things) I want to display a li...
New
Latest on Elixir Forum
Get money off!
The Pragmatic Bookshelf
35% off any eBook
Manning Publications
45% off any item
ElixirCasts
10% off for life
The Pragmatic Studio
20% off any course
AppSignal
10% off for 12 months
Honeybadger
10% off for 12 months
Simply use coupon code "devtalk.com" or "elixirforum" at checkout!
Filter by Type:
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #exunit
- #elixirconf
- #discussion
- #javascript
- #podcasts
- #code-sync
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #api
- #processes
- #forms
- #metaprogramming
- #security
- #performance
- #hex







