-
Notifications
You must be signed in to change notification settings - Fork 36
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
Changes from 62 commits
Commits
Show all changes
71 commits
Select commit
Hold shift + click to select a range
cffd41d
install nimble_options
pehbehbeh 9d0f9a6
add adapters docs group
pehbehbeh 72bcfaa
implement nimble_options validation for LiveResource
pehbehbeh 5150fb4
adjust all demo resources to new adapter_config syntax
pehbehbeh 1ffeca4
add basic upgrade guide
pehbehbeh 53100e6
start implementation of the adapter pattern and a basic ecto adapter
pehbehbeh fa64768
improve migration guide
pehbehbeh 5dc9d39
Merge branch 'develop' into feature/adapters
pehbehbeh 63f0111
implement get and get! adapter callbacks and move item_query
pehbehbeh d0c79b4
implement lost adapter callbacks and move more stuff
pehbehbeh 7e137db
remove duplicate code
pehbehbeh e183212
implement count adapter callback and move more stuff
pehbehbeh 754ade2
remove deprecated Resource.delete function
pehbehbeh 53b5b4e
remove deprecated Resource.metric_data function
pehbehbeh e194a4d
simplify call_changeset_function
pehbehbeh 6a18042
first steps towards moving insert/update/change stuff to adapters
pehbehbeh 8342bf6
move update_all to adapter
pehbehbeh e2cf868
please credo
pehbehbeh 928e384
change primary_key to be a live_resource setting
pehbehbeh 5993ca2
implement very basic draft of an ash adapter
pehbehbeh 89dbafe
fix unused alias
pehbehbeh 2224ba9
fix Resource.get
pehbehbeh a7978c5
add workaround for ecto seeds
pehbehbeh 4c90ac7
Merge branch 'develop' into feature/adapters
pehbehbeh f1a7839
implement init_order changes from #628 for new structure
pehbehbeh 258579a
add warnings to adapter and ash adapter
pehbehbeh edee0ea
change blog category back to ecto
pehbehbeh f292ba0
improve docs
pehbehbeh 9b500df
add ash helpdesk demo
pehbehbeh dad4b74
please the linters
pehbehbeh 8c2df14
fix formatting
pehbehbeh 64b23e1
Format migration
Flo0807 2718d0a
Include migration in demo `.formatter.exs`
Flo0807 a76273d
Remove subdirectories from backpex `.formatter.exs`
Flo0807 9dc332b
Update ID for helpdesk sidebar section
Flo0807 228486f
Update ticket alert colors
Flo0807 e688cda
Update film reviews alert colors
Flo0807 8a1af81
Update ticket alert text
Flo0807 8a91363
Use guard instead of adding another function pattern
Flo0807 d7fa361
Seed categories again
Flo0807 56d8541
Update adapter warning text
Flo0807 316f9d7
Update ash adapter docs
Flo0807 6672096
Disable ordering in ash resource
Flo0807 521c9df
Move ticket seeding
Flo0807 09cd3b0
Add missing doc comments
Flo0807 672c314
Add note for anonymous functions for init order configuration
Flo0807 7bc03bf
Change ash `delete_all` to not implemented
Flo0807 e2fa7af
Fix warning in upgrade guide
Flo0807 2cb3385
Add missing backquote
Flo0807 d7c1ec6
Add default for `after_save_fun` param
Flo0807 df157c7
Update pubsub configuration
Flo0807 28b5b16
Fix index edit does not work
Flo0807 5b13efe
Update lib/backpex/adapters/ash.ex
Flo0807 8c2014e
Add warning to ecto adapter doc
Flo0807 bcc866a
Update pubsub configuration
Flo0807 e765249
Remove backpex prefix in pubsub docs
Flo0807 158a750
Add upgrade guide to extras
Flo0807 96ff2d4
Improve upgrade guide
Flo0807 8a669d5
Pass assocs to changeset functions
Flo0807 49b9bae
Rename datalayer to data layer
Flo0807 4eeeda8
Fix index edit
Flo0807 939a54a
Use correct primary key for has many through
Flo0807 d44b3c0
Update docs
Flo0807 c0f3f84
Ensure Ash is loaded in ash adapter
Flo0807 4ce88ea
Update list function signature
Flo0807 e39615f
Update count function signature
Flo0807 d24de8b
Update item query guide
Flo0807 df0be0e
Update ordering guide
Flo0807 d64704f
Update upgrade guide
Flo0807 ad75a39
Update upgrade guide
Flo0807 1a596e0
Update upgrade guide
Flo0807 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
[ | ||
line_length: 120, | ||
import_deps: [:ecto, :phoenix, :backpex], | ||
import_deps: [:ecto, :phoenix, :backpex, :ash, :ash_postgres], | ||
plugins: [TailwindFormatter, Phoenix.LiveView.HTMLFormatter], | ||
inputs: ["*.{heex,ex,exs}", "priv/*/seeds.exs", "{config,lib,test}/**/*.{heex,ex,exs}"] | ||
inputs: ["*.{heex,ex,exs}", "priv/*/seeds.exs", "{config,lib,test}/**/*.{heex,ex,exs}"], | ||
subdirectories: ["priv/*/migrations"] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
defmodule Demo.Helpdesk.Ticket do | ||
@moduledoc false | ||
|
||
use Ash.Resource, | ||
domain: Demo.Helpdesk, | ||
data_layer: AshPostgres.DataLayer | ||
|
||
postgres do | ||
repo Demo.RepoAsh | ||
table "tickets" | ||
end | ||
|
||
actions do | ||
defaults [:read] | ||
end | ||
|
||
attributes do | ||
uuid_primary_key :id | ||
attribute :subject, :string, allow_nil?: false | ||
attribute :body, :string, allow_nil?: false | ||
create_timestamp :inserted_at | ||
update_timestamp :updated_at | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
defmodule Demo.Helpdesk do | ||
@moduledoc false | ||
|
||
use Ash.Domain | ||
|
||
resources do | ||
resource Demo.Helpdesk.Ticket | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should rename
Demo.Repo
toDemo.RepoEcto
accordingly.