Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite03cd0c

Browse files
committed
feat: support ash 1.7
1 parent870da16 commite03cd0c

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

‎lib/data_layer.ex‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ defmodule AshPostgres.DataLayer do
3636

3737
aliasAsh.Filter
3838
aliasAsh.Filter.{Expression,Not,Predicate}
39-
aliasAsh.Filter.Predicate.{Eq,GreaterThan,In,LessThan}
39+
aliasAsh.Filter.Predicate.{Eq,GreaterThan,In,IsNil,LessThan}
4040
aliasAshPostgres.Predicates.Trigram
4141

4242
importAshPostgres,only:[table:1,repo:1]
@@ -87,9 +87,11 @@ defmodule AshPostgres.DataLayer do
8787
defcan?(_,{:filter_predicate,_,%Eq{}}),do:true
8888
defcan?(_,{:filter_predicate,_,%LessThan{}}),do:true
8989
defcan?(_,{:filter_predicate,_,%GreaterThan{}}),do:true
90+
defcan?(_,{:filter_predicate,_,%IsNil{}}),do:true
9091
defcan?(_,{:filter_predicate,:string,%Trigram{}}),do:true
9192
defcan?(_,{:filter_predicate,_}),do:false
9293
defcan?(_,{:sort,_}),do:true
94+
defcan?(_,_),do:false
9395

9496
@impltrue
9597
defin_transaction?(resource)do
@@ -723,6 +725,15 @@ defmodule AshPostgres.DataLayer do
723725
)
724726
end
725727

728+
defpfilter_value_to_expr(attribute,%IsNil{nil?:true},_type,current_binding,params)do
729+
{params,{:is_nil,[],[{{:.,[],[{:&,[],[current_binding]},attribute]},[],[]}]}}
730+
end
731+
732+
defpfilter_value_to_expr(attribute,%IsNil{nil?:false},_type,current_binding,params)do
733+
{params,
734+
{:not,[],[{:is_nil,[],[{{:.,[],[{:&,[],[current_binding]},attribute]},[],[]}]}]}}
735+
end
736+
726737
defpfilter_value_to_expr(
727738
attribute,
728739
%Trigram{}=trigram,

‎mix.exs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ defmodule AshPostgres.MixProject do
6161
[
6262
{:ecto_sql,"~> 3.4"},
6363
{:postgrex,">= 0.0.0"},
64-
{:ash,"~> 1.6.0"},
64+
{:ash,"~> 1.7.0"},
6565
{:git_ops,"~> 2.0.1",only::dev},
6666
{:ex_doc,"~> 0.22",only::dev,runtime:false},
6767
{:ex_check,"~> 0.11.0",only::dev},

‎mix.lock‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
%{
2-
"ash":{:hex,:ash,"1.6.0","909cff290ff4ae0071fed02be02a7ec03ce68b4830f4edfbb5edf086086f495e",[:mix],[{:ecto,"~> 3.4",[hex::ecto,repo:"hexpm",optional:false]},{:ets,"~> 0.8.0",[hex::ets,repo:"hexpm",optional:false]},{:nimble_options,"~> 0.3.0",[hex::nimble_options,repo:"hexpm",optional:false]},{:picosat_elixir,"~> 0.1.4",[hex::picosat_elixir,repo:"hexpm",optional:false]}],"hexpm","c551dcd52daf04d2e4251f9b4cd5c431e4e93049703b012402f512a896036074"},
2+
"ash":{:hex,:ash,"1.7.0","a145845492d22f5c02a3bf6883e05016c15337d41fd877d66bcd43a6a4c522cc",[:mix],[{:ecto,"~> 3.4",[hex::ecto,repo:"hexpm",optional:false]},{:ets,"~> 0.8.0",[hex::ets,repo:"hexpm",optional:false]},{:nimble_options,"~> 0.3.0",[hex::nimble_options,repo:"hexpm",optional:false]},{:picosat_elixir,"~> 0.1.4",[hex::picosat_elixir,repo:"hexpm",optional:false]}],"hexpm","35b6131904b1dd7a477fc7975a468ca128307642ffe794ffd4e942c5b8514011"},
33
"bunt":{:hex,:bunt,"0.2.0","951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38",[:mix],[],"hexpm","7af5c7e09fe1d40f76c8e4f9dd2be7cebd83909f31fee7cd0e9eadc567da8353"},
44
"certifi":{:hex,:certifi,"2.5.2","b7cfeae9d2ed395695dd8201c57a2d019c0c43ecaf8b8bcb9320b40d6662f340",[:rebar3],[{:parse_trans,"~>3.3",[hex::parse_trans,repo:"hexpm",optional:false]}],"hexpm","3b3b5f36493004ac3455966991eaf6e768ce9884693d9968055aeeeb1e575040"},
55
"connection":{:hex,:connection,"1.0.4","a1cae72211f0eef17705aaededacac3eb30e6625b04a6117c1b2db6ace7d5976",[:mix],[],"hexpm","4a0850c9be22a43af9920a71ab17c051f5f7d45c209e40269a1938832510e4d9"},

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp