Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduction of the adapter pattern for flexible datasources #608

Merged
merged 71 commits into from
Oct 29, 2024

Conversation

pehbehbeh
Copy link
Member

@pehbehbeh pehbehbeh commented Sep 20, 2024

This is a WIP draft of the introduction of Backpex.Adapter and a Backpex.Adapters.Ecto. This will help us support other datasources (like Ash) in the future.

This PR also introduces validation for given options to Backpex.LiveResource via nimble_options.

@pehbehbeh pehbehbeh added the feature New feature label Sep 20, 2024
@Flo0807
Copy link
Collaborator

Flo0807 commented Oct 25, 2024

I just noticed that deleting the last HasManyThrough relation does not work anymore:

demo.mov
I tested the newest version of develop and everything seems to work fine there, so this MR breaks it.

It works if there is at least one HasManyThrough relation left, so deleting one out of two addresses works.

Ok, the reason is that we do not pass the assocs to the change function anymore.

@Flo0807
Copy link
Collaborator

Flo0807 commented Oct 28, 2024

I just noticed that deleting the last HasManyThrough relation does not work anymore:

demo.mov
I tested the newest version of develop and everything seems to work fine there, so this MR breaks it.

It works if there is at least one HasManyThrough relation left, so deleting one out of two addresses works.

Fixed.

@Flo0807 Flo0807 self-assigned this Oct 28, 2024
@Flo0807 Flo0807 added breaking-change A breaking change and removed feature New feature labels Oct 28, 2024
lib/backpex/resource.ex Outdated Show resolved Hide resolved
lib/backpex/resource.ex Outdated Show resolved Hide resolved
@@ -0,0 +1,114 @@
if Code.ensure_loaded?(Ash) do
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a better way to do this?

@Flo0807 Flo0807 merged commit 30b9a32 into develop Oct 29, 2024
6 checks passed
@Flo0807 Flo0807 deleted the feature/adapters branch October 29, 2024 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change A breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants