@@ -149,22 +149,22 @@ defmodule QueryTest do
149
149
assert [ [ % Duration { microsecond: { 0 , 6 } } ] ] =
150
150
P . query! ( pid , "SELECT interval '0'" , [ ] ) . rows
151
151
152
- assert [ [ % Duration { year: 100 , microsecond: { 0 , 6 } } ] ] =
152
+ assert [ [ % Duration { month: 1200 , microsecond: { 0 , 6 } } ] ] =
153
153
P . query! ( pid , "SELECT interval '100 years'" , [ ] ) . rows
154
154
155
155
assert [ [ % Duration { month: 10 , microsecond: { 0 , 6 } } ] ] =
156
156
P . query! ( pid , "SELECT interval '10 months'" , [ ] ) . rows
157
157
158
- assert [ [ % Duration { week: 100 , microsecond: { 0 , 6 } } ] ] =
158
+ assert [ [ % Duration { day: 700 , microsecond: { 0 , 6 } } ] ] =
159
159
P . query! ( pid , "SELECT interval '100 weeks'" , [ ] ) . rows
160
160
161
161
assert [ [ % Duration { day: 5 , microsecond: { 0 , 6 } } ] ] =
162
162
P . query! ( pid , "SELECT interval '5 days'" , [ ] ) . rows
163
163
164
- assert [ [ % Duration { hour: 100 , microsecond: { 0 , 6 } } ] ] =
164
+ assert [ [ % Duration { second: 360_000 , microsecond: { 0 , 6 } } ] ] =
165
165
P . query! ( pid , "SELECT interval '100 hours'" , [ ] ) . rows
166
166
167
- assert [ [ % Duration { minute: 10 , microsecond: { 0 , 6 } } ] ] =
167
+ assert [ [ % Duration { second: 600 , microsecond: { 0 , 6 } } ] ] =
168
168
P . query! ( pid , "SELECT interval '10 minutes'" , [ ] ) . rows
169
169
170
170
assert [ [ % Duration { second: 10 , microsecond: { 0 , 6 } } ] ] =
@@ -173,13 +173,9 @@ defmodule QueryTest do
173
173
assert [
174
174
[
175
175
% Duration {
176
- year: 1 ,
177
- month: 2 ,
178
- week: 5 ,
179
- day: 5 ,
180
- hour: 3 ,
181
- minute: 2 ,
182
- second: 1 ,
176
+ month: 14 ,
177
+ day: 40 ,
178
+ second: 10921 ,
183
179
microsecond: { 0 , 6 }
184
180
}
185
181
]
@@ -215,10 +211,10 @@ defmodule QueryTest do
215
211
opts = [ database: "postgrex_test" , backoff_type: :stop , types: Postgrex.ElixirDurationTypes ]
216
212
{ :ok , pid } = P . start_link ( opts )
217
213
218
- assert [ [ % Duration { week: 1 , day: 3 , microsecond: { 0 , 6 } } ] ] =
214
+ assert [ [ % Duration { day: 10 , microsecond: { 0 , 6 } } ] ] =
219
215
P . query! ( pid , "SELECT interval '10' DAY" , [ ] ) . rows
220
216
221
- assert [ [ [ % Duration { week: 1 , day: 3 , microsecond: { 0 , 6 } } ] ] ] =
217
+ assert [ [ [ % Duration { day: 10 , microsecond: { 0 , 6 } } ] ] ] =
222
218
P . query! ( pid , "SELECT ARRAY[interval '10' DAY]" , [ ] ) . rows
223
219
end
224
220
end
0 commit comments