mudspot

mudspot

Hi!

Any thoughts on how to get the above 2 to work together?

Best,
Terry

Showing Posts 1 to 10

zachdaniel

zachdaniel

Creator of Ash

Right now AFAIK Phoenix.Sync essentially maps an Ecto query to a shape, and those Ecto queries are quite limited at the moment, so there isn’t a way to take an arbitrary ash query and turn it into a shape etc.

What kind of integration are you looking for?

mudspot

mudspot OP

I have lambda functions that compute on the db and modifies the tables accordingly.

On the app side, of course its a LV → business logic → Ash → DB stack. So trying to cook up a design that lets the LV update when the data tables have been changed (by the lambda functions)

zachdaniel

zachdaniel

Creator of Ash

Yeah it’s an interesting question :slight_smile: You could definitely set something up with Phoenix.Sync treating your Ash resources as Ecto schemas. How you actually hook that up to do useful things is kind of its own question :slight_smile: I’ve had some chats with them about making something that works directly w/ Ash but nothing has materialized as of yet.

sezaru

sezaru

Sorry for revive this post, but I though it would be better than create a new one..

Do we have some news regarding Phoenix.Sync integration with Ash? I was looking at the presentation of the tech from James Arthur here https://www.youtube.com/watch?v=4IWShnVuRCg and I would love to be able to use it in my backend.

More specifically, the part that I was more interested was the integration with LiveView via sync_stream, but instead of using Ecto schemas/queries, I would love to be able to use Ash queries from resource actions.

Is there some plan or conversation about adding some support for it?

PS. I did find kinda ironic and funny that James was using an Ash t shirt during the presentation but at the same time the library didn’t have any support for Ash haha :sweat_smile:

zachdaniel

zachdaniel

Creator of Ash

I’ve explored it, and have a POC, but there are some challenges. One of the main ones is the lack of multi-table shapes. however, we have added a utility that would allow you to roll your own here.

Resource
|> Ash.Query.for_read(....)
|> Ash.data_layer_query()

with returns something like {:ok, %{query: ecto_query}}. You could then use that ecto_query with Phoenix.Sync, in the case that it is compatible. That Ecto query will include policies, filters, calculations etc.

sezaru

sezaru

I don’t know if that changed, but, last time that I tried data_layer_query, it would generate a wrong query if the resource uses a custom schema, is that still the case?

zachdaniel

zachdaniel

Creator of Ash

they are different, you’re thinking of Ash.Query.data_layer_query, this is new, it’s Ash.data_layer_query and it should be exactly the query the data layer will run.

sezaru

sezaru

Ah, sorry, I didn’t realize that. I will try that out thanks!

mudspot

mudspot OP

Ash T-shirt? Where can I lay my hands on one?!

zachdaniel

zachdaniel

Creator of Ash

There will be a method to acquire Ash tshirts soon :smiling_face_with_sunglasses:

Where Next? Top

Trending in Questions Top

stjefim
Hello! Suppose you are building workflow (order / task / payment) processing system with the following requirements: Each workflow con...
New
jonnycharles
I’m in search of an Elixir library that offers PDF generation capabilities similar to Ruby’s Prawn. While there have been discussions abo...
New
spammy
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
dli
Before I dive in myself, did anyone successfully sprinkle Hologram into their existing LiveView app? Looking for hints regarding: Addi...
New
roeland
Kia ora, We have been using elixir-google-api to connect to Google Drive. However, with the updates to Tesla due to CVEs this is now bro...
New
bottlenecked
Hi all, I wanted to ask how the community is dealing with post-release steps. Today we have Ecto migrations, which make sure that the db...
New
rahultumpala
Hello, I have an Elixir backend that implements a custom protocol over TCP. I want to load test the backend and assess the performance o...
New

Other Trending Topics Top

JesseHerrick
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
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews