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

Commitb78b391

Browse files
committed
chore: fix ash support
1 parent9eb7034 commitb78b391

File tree

3 files changed

+18
-16
lines changed

3 files changed

+18
-16
lines changed

‎mix.exs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ defmodule AshPostgres.MixProject do
6868
{:ecto_sql,"~> 3.4"},
6969
{:jason,"~> 1.0"},
7070
{:postgrex,">= 0.0.0"},
71-
{:ash,ash_version("~> 1.15")},
71+
{:ash,ash_version("~> 1.19")},
7272
{:git_ops,"~> 2.0.1",only::dev},
7373
{:ex_doc,"~> 0.22",only::dev,runtime:false},
7474
{: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.15.1","47ed03d631a695ba98e0e6e0ca655840286bf14457d8052fb5ff0a4160b50471",[: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.5",[hex::picosat_elixir,repo:"hexpm",optional:false]}],"hexpm","6036a934f22e89a1e1e9d080af7eac6377b76260d591bcb70c830546163dd006"},
2+
"ash":{:hex,:ash,"1.19.1","49d9ac6c8460170d8546683b27388fa9374bc39b1101819b3bd84ef35d689257",[: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.5",[hex::picosat_elixir,repo:"hexpm",optional:false]}],"hexpm","ab0eb80cd587189bd04209756bbc47a654182e8bdce9524310f118368b0066d6"},
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"},

‎test/filter_test.exs‎

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ defmodule AshPostgres.FilterTest do
22
useAshPostgres.RepoCase,async:false
33
aliasAshPostgres.Test.{Api,Comment,Post}
44

5+
requireAsh.Query
6+
57
describe"with no filter applied"do
68
test"with no data"do
79
assert[]=Api.read!(Post)
@@ -20,7 +22,7 @@ defmodule AshPostgres.FilterTest do
2022
test"with no data"do
2123
results=
2224
Post
23-
|>Ash.Query.filter(title:"title")
25+
|>Ash.Query.filter(title=="title")
2426
|>Api.read!()
2527

2628
assert[]=results
@@ -33,7 +35,7 @@ defmodule AshPostgres.FilterTest do
3335

3436
results=
3537
Post
36-
|>Ash.Query.filter(title:"title")
38+
|>Ash.Query.filter(title=="title")
3739
|>Api.read!()
3840

3941
assert[%Post{title:"title"}]=results
@@ -46,7 +48,7 @@ defmodule AshPostgres.FilterTest do
4648

4749
results=
4850
Post
49-
|>Ash.Query.filter(title:"no_title")
51+
|>Ash.Query.filter(title=="no_title")
5052
|>Api.read!()
5153

5254
assert[]=results
@@ -65,7 +67,7 @@ defmodule AshPostgres.FilterTest do
6567

6668
results=
6769
Post
68-
|>Ash.Query.filter(comments:[title:"match"])
70+
|>Ash.Query.filter(comments.title=="match")
6971
|>Api.read!()
7072

7173
assert[]=results
@@ -84,7 +86,7 @@ defmodule AshPostgres.FilterTest do
8486

8587
results=
8688
Post
87-
|>Ash.Query.filter(comments:[title:"match"])
89+
|>Ash.Query.filter(comments.title=="match")
8890
|>Api.read!()
8991

9092
assert[%Post{title:"title"}]=results
@@ -108,7 +110,7 @@ defmodule AshPostgres.FilterTest do
108110

109111
results=
110112
Post
111-
|>Ash.Query.filter(comments:[title:"match"])
113+
|>Ash.Query.filter(comments.title=="match")
112114
|>Api.read!()
113115

114116
assert[%Post{title:"title"}]=results
@@ -119,7 +121,7 @@ defmodule AshPostgres.FilterTest do
119121
test"with no data"do
120122
results=
121123
Post
122-
|>Ash.Query.filter(or:[[title:"title"],[score:1]])
124+
|>Ash.Query.filter(title=="title"orscore==1)
123125
|>Api.read!()
124126

125127
assert[]=results
@@ -132,7 +134,7 @@ defmodule AshPostgres.FilterTest do
132134

133135
results=
134136
Post
135-
|>Ash.Query.filter(or:[[title:"title"],[score:1]])
137+
|>Ash.Query.filter(title=="title"orscore==1)
136138
|>Api.read!()
137139

138140
assert[]=results
@@ -149,7 +151,7 @@ defmodule AshPostgres.FilterTest do
149151

150152
results=
151153
Post
152-
|>Ash.Query.filter(or:[[title:"title"],[score:1]])
154+
|>Ash.Query.filter(title=="title"orscore==1)
153155
|>Api.read!()
154156
|>Enum.sort_by(&&1.score)
155157

@@ -167,7 +169,7 @@ defmodule AshPostgres.FilterTest do
167169

168170
results=
169171
Post
170-
|>Ash.Query.filter(or:[[title:"title"],[score:1]])
172+
|>Ash.Query.filter(title=="title"orscore==1)
171173
|>Api.read!()
172174
|>Enum.sort_by(&&1.score)
173175

@@ -187,7 +189,7 @@ defmodule AshPostgres.FilterTest do
187189

188190
results=
189191
Post
190-
|>Ash.Query.filter(or:[[title:"match"],[comments:[title:"match"]]])
192+
|>Ash.Query.filter(title=="match"orcomments.title=="match")
191193
|>Api.read!()
192194

193195
assert[%Post{title:"doesn't match"}]=results
@@ -206,7 +208,7 @@ defmodule AshPostgres.FilterTest do
206208

207209
results=
208210
Post
209-
|>Ash.Query.filter(or:[[title:"match"],[comments:[title:"match"]]])
211+
|>Ash.Query.filter(title=="match"orcomments.title=="match")
210212
|>Api.read!()
211213

212214
assert[%Post{title:"match"}]=results
@@ -221,7 +223,7 @@ defmodule AshPostgres.FilterTest do
221223

222224
results=
223225
Post
224-
|>Ash.Query.filter(trigram_similarity:[:title,"match",[greater_than:0.9]])
226+
|>Ash.Query.filter(trigram_similarity(title,"match",greater_than:0.9))
225227
|>Api.read!()
226228

227229
assert[%Post{title:"match"}]=results
@@ -234,7 +236,7 @@ defmodule AshPostgres.FilterTest do
234236

235237
results=
236238
Post
237-
|>Ash.Query.filter(trigram_similarity:[:title,"match",[less_than:0.1]])
239+
|>Ash.Query.filter(trigram_similarity(title,"match",less_than:0.1))
238240
|>Api.read!()
239241

240242
assert[]=results

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp