mirror of
https://github.com/jackfoxy/urQL.git
synced 2024-08-16 23:30:51 +03:00
delete as of
This commit is contained in:
parent
097076f693
commit
aa959312a6
@ -1418,6 +1418,37 @@
|
||||
==
|
||||
end-or-next-command
|
||||
==
|
||||
++ parse-delete ~+
|
||||
;~ pose
|
||||
;~ plug
|
||||
;~(pfix whitespace parse-qualified-3object)
|
||||
;~ pose
|
||||
;~ pfix whitespace
|
||||
;~ plug (cold %where (jester 'where'))
|
||||
parse-predicate
|
||||
parse-as-of
|
||||
end-or-next-command
|
||||
==
|
||||
==
|
||||
;~ plug
|
||||
parse-as-of
|
||||
end-or-next-command
|
||||
==
|
||||
==
|
||||
==
|
||||
;~ plug
|
||||
;~(pfix whitespace parse-qualified-3object)
|
||||
;~ pose
|
||||
;~ pfix whitespace
|
||||
;~ plug (cold %where (jester 'where'))
|
||||
parse-predicate
|
||||
end-or-next-command
|
||||
==
|
||||
==
|
||||
end-or-next-command
|
||||
==
|
||||
==
|
||||
==
|
||||
++ parse-drop-database ~+
|
||||
;~ sfix
|
||||
;~ pose
|
||||
@ -1625,19 +1656,6 @@
|
||||
parse-select
|
||||
end-or-next-command
|
||||
==
|
||||
++ parse-delete ~+
|
||||
;~ plug
|
||||
;~(pfix whitespace parse-qualified-3object)
|
||||
;~ pose
|
||||
;~ pfix whitespace
|
||||
;~ plug (cold %where (jester 'where'))
|
||||
parse-predicate
|
||||
end-or-next-command
|
||||
==
|
||||
==
|
||||
end-or-next-command
|
||||
==
|
||||
==
|
||||
++ merge-stop ~+
|
||||
;~ pose
|
||||
;~(plug (jester 'with') whitespace)
|
||||
@ -3897,11 +3915,36 @@
|
||||
|= a=*
|
||||
^- delete:ast
|
||||
?> ?=(qualified-object:ast -.a)
|
||||
?: =(%end-command +<.a)
|
||||
?: ?=([* %end-command ~] a) :: delete foo; delete from foo
|
||||
(delete:ast %delete -.a ~ ~)
|
||||
?: =(%where +<.a)
|
||||
:: delete foo as of now; delete from foo as of now
|
||||
?: ?=([* [%as-of %now] %end-command ~] a)
|
||||
(delete:ast %delete -.a ~ ~)
|
||||
?: ?=([* [%as-of [@ @]] %end-command ~] a) :: delete from foo as of date
|
||||
(delete:ast %delete -.a ~ [~ +<+>.a])
|
||||
?: ?=([* [%as-of *] %end-command ~] a) :: delete from foo as of offset
|
||||
%: delete:ast %delete
|
||||
-.a
|
||||
~
|
||||
[~ (as-of-offset:ast %as-of-offset +<+<.a +<+>-.a)]
|
||||
==
|
||||
?: ?=([* %where * %end-command ~] a)
|
||||
(delete:ast %delete -.a `(produce-predicate (predicate-list +>-.a)) ~)
|
||||
(delete:ast %delete -.a `(produce-predicate (predicate-list +>->.a)) ~)
|
||||
?: ?=([* %where * [%as-of %now] %end-command ~] a)
|
||||
(delete:ast %delete -.a `(produce-predicate (predicate-list +>-.a)) ~)
|
||||
?: ?=([* %where * [%as-of [@ @]] %end-command ~] a)
|
||||
%: delete:ast %delete
|
||||
-.a
|
||||
`(produce-predicate (predicate-list +>-.a))
|
||||
[~ +>+<+>.a]
|
||||
==
|
||||
?: ?=([* %where * [%as-of *] %end-command ~] a)
|
||||
%: delete:ast %delete
|
||||
-.a
|
||||
`(produce-predicate (predicate-list +>-.a))
|
||||
[~ (as-of-offset:ast %as-of-offset +>+<+<.a +>+<+>-.a)]
|
||||
==
|
||||
!!
|
||||
+$ select-mold-1
|
||||
$:
|
||||
[%selected-aggregate @ %qualified-column [%qualified-object @ @ @ @] @ @]
|
||||
|
@ -2,240 +2,204 @@
|
||||
/+ parse, *test
|
||||
|%
|
||||
|
||||
++ column-foo [%qualified-column qualifier=[%qualified-object ship=~ database='UNKNOWN' namespace='COLUMN-OR-CTE' name='foo'] column='foo' alias=~]
|
||||
++ column-bar [%qualified-column qualifier=[%qualified-object ship=~ database='UNKNOWN' namespace='COLUMN-OR-CTE' name='bar'] column='bar' alias=~]
|
||||
++ all-columns [%qualified-object ship=~ database='ALL' namespace='ALL' name='ALL']
|
||||
++ select-all-columns [%select top=~ bottom=~ columns=~[all-columns]]
|
||||
++ col1
|
||||
[%qualified-column qualifier=[%qualified-object ship=~ database='UNKNOWN' namespace='COLUMN-OR-CTE' name='col1'] column='col1' alias=~]
|
||||
++ col2
|
||||
[%qualified-column qualifier=[%qualified-object ship=~ database='UNKNOWN' namespace='COLUMN-OR-CTE' name='col2'] column='col2' alias=~]
|
||||
++ col3
|
||||
[%qualified-column qualifier=[%qualified-object ship=~ database='UNKNOWN' namespace='COLUMN-OR-CTE' name='col3'] column='col3' alias=~]
|
||||
++ col4
|
||||
[%qualified-column qualifier=[%qualified-object ship=~ database='UNKNOWN' namespace='COLUMN-OR-CTE' name='col4'] column='col4' alias=~]
|
||||
++ delete-pred
|
||||
`[%eq [column-foo ~ ~] [column-bar ~ ~]]
|
||||
++ cte-t1
|
||||
[%cte name='t1' [%query ~ scalars=~ predicate=~ group-by=~ having=~ selection=select-all-columns ~]]
|
||||
++ cte-foobar
|
||||
[%cte name='foobar' [%query [~ [%from object=[%table-set object=[%qualified-object ship=~ database='db1' namespace='dbo' name='foobar'] alias=~] joins=~]] scalars=~ `[%eq [col1 ~ ~] [[value-type=%ud value=2] ~ ~]] group-by=~ having=~ [%select top=~ bottom=~ columns=~[col3 col4]] ~]]
|
||||
++ cte-bar
|
||||
[%cte name='bar' [%query [~ [%from object=[%table-set object=[%qualified-object ship=~ database='db1' namespace='dbo' name='bar'] alias=~] joins=~]] scalars=~ `[%eq [col1 ~ ~] [col2 ~ ~]] group-by=~ having=~ [%select top=~ bottom=~ columns=~[col2]] ~]]
|
||||
++ foo-table
|
||||
[%qualified-object ship=~ database='db1' namespace='dbo' name='foo']
|
||||
::@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||
|
||||
::
|
||||
:: insert
|
||||
::
|
||||
:: tests 1, 2, 3, 5, and extra whitespace characters, db.ns.table, db..table, colum list, two value rows, one value row, no space around ; delimeter
|
||||
:: NOTE: the parser does not check:
|
||||
:: 1) validity of columns re parent table
|
||||
:: 2) match column count to values count
|
||||
:: 3) enforce consistent value counts across rows
|
||||
++ test-insert-00
|
||||
=/ expected1
|
||||
:+ %transform
|
||||
ctes=~
|
||||
:+ :* %insert
|
||||
table=[%qualified-object ship=~ database='db' namespace='ns' name='my-table']
|
||||
columns=`['col1' 'col2' 'col3' 'col4' 'col5' 'col6' 'col7' 'col8' 'col9' ~]
|
||||
values=[%data ~[~[[~.t 1.685.221.219] [~.rs 1.078.523.331] [~.sd 39] [~.ud 20] [~.rs 1.078.523.331] [~.p 28.242.037] [~.rs 3.226.006.979] [~.t 430.158.540.643] [~.sd 6]] ~[[~.default 32.770.348.699.510.116] [~.if 3.284.569.946] [~.ud 195.198.143.900]]]]
|
||||
as-of=~
|
||||
==
|
||||
~
|
||||
~
|
||||
=/ expected2
|
||||
:+ %transform
|
||||
ctes=~
|
||||
:+ :* %insert
|
||||
table=[%qualified-object ship=~ database='db' namespace='dbo' name='my-table']
|
||||
columns=`['col1' 'col2' 'col3' 'col4' 'col5' 'col6' 'col7' 'col8' 'col9' ~]
|
||||
values=[%data ~[~[[~.t 1.685.221.219] [~.rs 1.078.523.331] [~.sd 39] [~.ud 20] [~.rs 1.078.523.331] [~.p 28.242.037] [~.rs 3.226.006.979] [~.t 430.158.540.643] [~.sd 6]]]]
|
||||
as-of=~
|
||||
==
|
||||
~
|
||||
~
|
||||
=/ urql1 " iNsert iNto db.ns.my-table ".
|
||||
"( col1 , col2 , col3 , col4 , col5 , col6 , col7 , col8 , col9 )".
|
||||
" Values ('cord',.3.14,-20,20,.3.14,~nomryg-nilref,.-3.14, 'cor\\'d', --3)".
|
||||
" (Default,.195.198.143.90, 195.198.143.900)"
|
||||
=/ urql2 "insert into db..my-table ".
|
||||
"(col1, col2, col3, col4, col5, col6, col7, col8, col9)".
|
||||
"valueS ('cord',.3.14,-20,20,.3.14,~nomryg-nilref,.-3.14, 'cor\\'d', --3)"
|
||||
:: delete from foo;delete foo
|
||||
++ test-delete-00
|
||||
=/ expected1 [%transform ctes=~ [[%delete table=foo-table ~ ~] ~ ~]]
|
||||
=/ expected2 [%transform ctes=~ [[%delete table=foo-table ~ ~] ~ ~]]
|
||||
%+ expect-eq
|
||||
!> ~[expected1 expected2]
|
||||
!> (parse:parse(default-database 'other-db') (weld urql1 (weld ";" urql2)))
|
||||
!> (parse:parse(default-database 'db1') "delete from foo;delete foo")
|
||||
::
|
||||
:: no columns, 3 rows
|
||||
++ test-insert-01
|
||||
=/ expected
|
||||
:+ %transform
|
||||
ctes=~
|
||||
:+ :* %insert
|
||||
table=[%qualified-object ship=~ database='db1' namespace='dbo' name='my-table']
|
||||
columns=~
|
||||
values=[%data ~[~[[~.t 1.685.221.219] [~.rs 1.078.523.331] [~.sd 39] [~.ud 20] [~.rs 1.078.523.331] [~.p 28.242.037] [~.rs 3.226.006.979] [~.t 430.158.540.643] [~.sd 6]] ~[[~.default 32.770.348.699.510.116] [~.if 3.284.569.946] [~.ud 195.198.143.900]] ~[[~.ud 2.222] [~.ud 2.222] [~.ud 195.198.143.900] [~.rs 1.078.523.331] [~.rs 3.226.006.979] [~.rd 4.614.253.070.214.989.087] [~.rd 13.837.625.107.069.764.895] [~.ux 1.205.249] [~.ub 43] [~.sd 39] [~.sd 40] [~.uw 61.764.130.813.526] [~.uw 1.870.418.170.505.042.572.886]]]]
|
||||
as-of=~
|
||||
==
|
||||
~
|
||||
~
|
||||
=/ urql "insert into my-table ".
|
||||
"values ('cord',.3.14,-20,20,.3.14,~nomryg-nilref,.-3.14, 'cor\\'d', --3)".
|
||||
" (default,.195.198.143.90, 195.198.143.900)".
|
||||
" (2.222,2222,195.198.143.900,.3.14,.-3.14,~3.14,~-3.14,0x12.6401,10.1011,-20,--20,e2O.l4Xpm,pm.l4e2O.l4Xpm)"
|
||||
:: delete from foo as of now;delete foo as of now
|
||||
++ test-delete-01
|
||||
=/ expected1 [%transform ctes=~ [[%delete table=foo-table ~ ~] ~ ~]]
|
||||
=/ expected2 [%transform ctes=~ [[%delete table=foo-table ~ ~] ~ ~]]
|
||||
%+ expect-eq
|
||||
!> ~[expected1 expected2]
|
||||
!> (parse:parse(default-database 'db1') "delete from foo as of now;delete foo as of now")
|
||||
::
|
||||
:: delete from foo as of ~2023.12.25..7.15.0..1ef5;delete foo as of ~2023.12.25..7.15.0..1ef5
|
||||
++ test-delete-02
|
||||
=/ expected1 [%transform ctes=~ [[%delete table=foo-table ~ [~ ~2023.12.25..7.15.0..1ef5]] ~ ~]]
|
||||
=/ expected2 [%transform ctes=~ [[%delete table=foo-table ~ [~ ~2023.12.25..7.15.0..1ef5]] ~ ~]]
|
||||
%+ expect-eq
|
||||
!> ~[expected1 expected2]
|
||||
!> (parse:parse(default-database 'db1') "delete from foo as of 2023.12.25..7.15.0..1ef5;delete foo as of ~2023.12.25..7.15.0..1ef5")
|
||||
::
|
||||
:: delete from foo as of 5 seconds ago;delete foo as of 5 seconds ago
|
||||
++ test-delete-03
|
||||
=/ expected1 [%transform ctes=~ [[%delete table=foo-table ~ [~ [%as-of-offset 5 %seconds]]] ~ ~]]
|
||||
=/ expected2 [%transform ctes=~ [[%delete table=foo-table ~ [~ [%as-of-offset 4 %seconds]]] ~ ~]]
|
||||
%+ expect-eq
|
||||
!> ~[expected1 expected2]
|
||||
!> (parse:parse(default-database 'db1') "delete from foo as of 5 seconds ago;delete foo as of 4 seconds ago")
|
||||
::
|
||||
:: delete with predicate as
|
||||
++ test-delete-04
|
||||
=/ expected [%transform ctes=~ [[%delete table=foo-table delete-pred ~] ~ ~]]
|
||||
%+ expect-eq
|
||||
!> ~[expected]
|
||||
!> (parse:parse(default-database 'db1') urql)
|
||||
!> (parse:parse(default-database 'db1') "delete from foo where foo=bar")
|
||||
::
|
||||
:: no columns, 3 rows, as of now
|
||||
++ test-insert-02
|
||||
=/ expected
|
||||
:+ %transform
|
||||
ctes=~
|
||||
:+ :* %insert
|
||||
table=[%qualified-object ship=~ database='db1' namespace='dbo' name='my-table']
|
||||
columns=~
|
||||
values=[%data ~[~[[~.t 1.685.221.219] [~.rs 1.078.523.331] [~.sd 39] [~.ud 20] [~.rs 1.078.523.331] [~.p 28.242.037] [~.rs 3.226.006.979] [~.t 430.158.540.643] [~.sd 6]] ~[[~.default 32.770.348.699.510.116] [~.if 3.284.569.946] [~.ud 195.198.143.900]] ~[[~.ud 2.222] [~.ud 2.222] [~.ud 195.198.143.900] [~.rs 1.078.523.331] [~.rs 3.226.006.979] [~.rd 4.614.253.070.214.989.087] [~.rd 13.837.625.107.069.764.895] [~.ux 1.205.249] [~.ub 43] [~.sd 39] [~.sd 40] [~.uw 61.764.130.813.526] [~.uw 1.870.418.170.505.042.572.886]]]]
|
||||
as-of=~
|
||||
==
|
||||
~
|
||||
~
|
||||
=/ urql "insert into my-table ".
|
||||
"values ('cord',.3.14,-20,20,.3.14,~nomryg-nilref,.-3.14, 'cor\\'d', --3)".
|
||||
" (default,.195.198.143.90, 195.198.143.900)".
|
||||
" (2.222,2222,195.198.143.900,.3.14,.-3.14,~3.14,~-3.14,0x12.6401,10.1011,-20,--20,e2O.l4Xpm,pm.l4e2O.l4Xpm)".
|
||||
" as of now"
|
||||
:: delete with predicate of now
|
||||
++ test-delete-05
|
||||
=/ expected [%transform ctes=~ [[%delete table=foo-table delete-pred ~] ~ ~]]
|
||||
%+ expect-eq
|
||||
!> ~[expected]
|
||||
!> (parse:parse(default-database 'db1') urql)
|
||||
!> (parse:parse(default-database 'db1') "delete from foo where foo=bar as of now")
|
||||
::
|
||||
:: no columns, 3 rows, as of ~2023.12.25..7.15.0..1ef5
|
||||
++ test-insert-03
|
||||
=/ expected
|
||||
:+ %transform
|
||||
ctes=~
|
||||
:+ :* %insert
|
||||
table=[%qualified-object ship=~ database='db1' namespace='dbo' name='my-table']
|
||||
columns=~
|
||||
values=[%data ~[~[[~.t 1.685.221.219] [~.rs 1.078.523.331] [~.sd 39] [~.ud 20] [~.rs 1.078.523.331] [~.p 28.242.037] [~.rs 3.226.006.979] [~.t 430.158.540.643] [~.sd 6]] ~[[~.default 32.770.348.699.510.116] [~.if 3.284.569.946] [~.ud 195.198.143.900]] ~[[~.ud 2.222] [~.ud 2.222] [~.ud 195.198.143.900] [~.rs 1.078.523.331] [~.rs 3.226.006.979] [~.rd 4.614.253.070.214.989.087] [~.rd 13.837.625.107.069.764.895] [~.ux 1.205.249] [~.ub 43] [~.sd 39] [~.sd 40] [~.uw 61.764.130.813.526] [~.uw 1.870.418.170.505.042.572.886]]]]
|
||||
as-of=[~ ~2023.12.25..7.15.0..1ef5]
|
||||
==
|
||||
~
|
||||
~
|
||||
=/ urql "insert into my-table ".
|
||||
"values ('cord',.3.14,-20,20,.3.14,~nomryg-nilref,.-3.14, 'cor\\'d', --3)".
|
||||
" (default,.195.198.143.90, 195.198.143.900)".
|
||||
" (2.222,2222,195.198.143.900,.3.14,.-3.14,~3.14,~-3.14,0x12.6401,10.1011,-20,--20,e2O.l4Xpm,pm.l4e2O.l4Xpm)".
|
||||
" as of ~2023.12.25..7.15.0..1ef5"
|
||||
:: delete with predicate of ~2023.12.25..7.15.0..1ef5
|
||||
++ test-delete-06
|
||||
=/ expected [%transform ctes=~ [[%delete table=foo-table delete-pred [~ ~2023.12.25..7.15.0..1ef5]] ~ ~]]
|
||||
%+ expect-eq
|
||||
!> ~[expected]
|
||||
!> (parse:parse(default-database 'db1') urql)
|
||||
!> (parse:parse(default-database 'db1') "delete from foo where foo=bar as of ~2023.12.25..7.15.0..1ef5")
|
||||
::
|
||||
:: no columns, 3 rows, as of 5 days ago
|
||||
++ test-insert-04
|
||||
=/ expected
|
||||
:+ %transform
|
||||
ctes=~
|
||||
:+ :* %insert
|
||||
table=[%qualified-object ship=~ database='db1' namespace='dbo' name='my-table']
|
||||
columns=~
|
||||
values=[%data ~[~[[~.t 1.685.221.219] [~.rs 1.078.523.331] [~.sd 39] [~.ud 20] [~.rs 1.078.523.331] [~.p 28.242.037] [~.rs 3.226.006.979] [~.t 430.158.540.643] [~.sd 6]] ~[[~.default 32.770.348.699.510.116] [~.if 3.284.569.946] [~.ud 195.198.143.900]] ~[[~.ud 2.222] [~.ud 2.222] [~.ud 195.198.143.900] [~.rs 1.078.523.331] [~.rs 3.226.006.979] [~.rd 4.614.253.070.214.989.087] [~.rd 13.837.625.107.069.764.895] [~.ux 1.205.249] [~.ub 43] [~.sd 39] [~.sd 40] [~.uw 61.764.130.813.526] [~.uw 1.870.418.170.505.042.572.886]]]]
|
||||
as-of=[~ %as-of-offset 5 %days]
|
||||
==
|
||||
~
|
||||
~
|
||||
=/ urql "insert into my-table ".
|
||||
"values ('cord',.3.14,-20,20,.3.14,~nomryg-nilref,.-3.14, 'cor\\'d', --3)".
|
||||
" (default,.195.198.143.90, 195.198.143.900)".
|
||||
" (2.222,2222,195.198.143.900,.3.14,.-3.14,~3.14,~-3.14,0x12.6401,10.1011,-20,--20,e2O.l4Xpm,pm.l4e2O.l4Xpm)".
|
||||
" as of 5 days ago"
|
||||
:: delete with predicate of 5 seconds ago
|
||||
++ test-delete-07
|
||||
=/ expected [%transform ctes=~ [[%delete table=foo-table delete-pred [~ [%as-of-offset 5 %seconds]]] ~ ~]]
|
||||
%+ expect-eq
|
||||
!> ~[expected]
|
||||
!> (parse:parse(default-database 'db1') urql)
|
||||
!> (parse:parse(default-database 'db1') "delete from foo where foo=bar as of 5 seconds ago")
|
||||
::
|
||||
:: no columns, 3 rows, as of now
|
||||
++ test-insert-05
|
||||
=/ expected
|
||||
:+ %transform
|
||||
ctes=~
|
||||
:+ :* %insert
|
||||
table=[%qualified-object ship=~ database='db' namespace='ns' name='my-table']
|
||||
columns=`['col1' 'col2' 'col3' 'col4' 'col5' 'col6' 'col7' 'col8' 'col9' ~]
|
||||
values=[%data ~[~[[~.t 1.685.221.219] [~.rs 1.078.523.331] [~.sd 39] [~.ud 20] [~.rs 1.078.523.331] [~.p 28.242.037] [~.rs 3.226.006.979] [~.t 430.158.540.643] [~.sd 6]] ~[[~.default 32.770.348.699.510.116] [~.if 3.284.569.946] [~.ud 195.198.143.900]]]]
|
||||
as-of=~
|
||||
==
|
||||
~
|
||||
~
|
||||
=/ urql "insert into db.ns.my-table ".
|
||||
"(col1, col2, col3, col4, col5, col6, col7, col8, col9 )".
|
||||
" values ('cord',.3.14,-20,20,.3.14,~nomryg-nilref,.-3.14, 'cor\\'d', --3)".
|
||||
" (default,.195.198.143.90, 195.198.143.900) as of now"
|
||||
:: delete with one cte and predicate
|
||||
++ test-delete-08
|
||||
=/ expected [%transform ctes=~[cte-t1] [[%delete table=foo-table delete-pred ~] ~ ~]]
|
||||
%+ expect-eq
|
||||
!> ~[expected]
|
||||
!> (parse:parse(default-database 'other-db') urql)
|
||||
!> (parse:parse(default-database 'db1') "with (select *) as t1 delete from foo where foo=bar")
|
||||
::
|
||||
:: no columns, 3 rows, as of now
|
||||
++ test-insert-06
|
||||
=/ expected
|
||||
:+ %transform
|
||||
ctes=~
|
||||
:+ :* %insert
|
||||
table=[%qualified-object ship=~ database='db' namespace='ns' name='my-table']
|
||||
columns=`['col1' 'col2' 'col3' 'col4' 'col5' 'col6' 'col7' 'col8' 'col9' ~]
|
||||
values=[%data ~[~[[~.t 1.685.221.219] [~.rs 1.078.523.331] [~.sd 39] [~.ud 20] [~.rs 1.078.523.331] [~.p 28.242.037] [~.rs 3.226.006.979] [~.t 430.158.540.643] [~.sd 6]] ~[[~.default 32.770.348.699.510.116] [~.if 3.284.569.946] [~.ud 195.198.143.900]]]]
|
||||
as-of=[~ ~2023.12.25..7.15.0..1ef5]
|
||||
==
|
||||
~
|
||||
~
|
||||
=/ urql "insert into db.ns.my-table ".
|
||||
"(col1, col2, col3, col4, col5, col6, col7, col8, col9 )".
|
||||
" values ('cord',.3.14,-20,20,.3.14,~nomryg-nilref,.-3.14, 'cor\\'d', --3)".
|
||||
" (default,.195.198.143.90, 195.198.143.900) as of ~2023.12.25..7.15.0..1ef5"
|
||||
:: delete with one cte and predicate as of now
|
||||
++ test-delete-09
|
||||
=/ expected [%transform ctes=~[cte-t1] [[%delete table=foo-table delete-pred ~] ~ ~]]
|
||||
%+ expect-eq
|
||||
!> ~[expected]
|
||||
!> (parse:parse(default-database 'other-db') urql)
|
||||
!> (parse:parse(default-database 'db1') "with (select *) as t1 delete from foo where foo=bar as of now")
|
||||
::
|
||||
:: no columns, 3 rows, as of offset
|
||||
++ test-insert-07
|
||||
=/ expected
|
||||
:+ %transform
|
||||
ctes=~
|
||||
:+ :* %insert
|
||||
table=[%qualified-object ship=~ database='db' namespace='ns' name='my-table']
|
||||
columns=`['col1' 'col2' 'col3' 'col4' 'col5' 'col6' 'col7' 'col8' 'col9' ~]
|
||||
values=[%data ~[~[[~.t 1.685.221.219] [~.rs 1.078.523.331] [~.sd 39] [~.ud 20] [~.rs 1.078.523.331] [~.p 28.242.037] [~.rs 3.226.006.979] [~.t 430.158.540.643] [~.sd 6]] ~[[~.default 32.770.348.699.510.116] [~.if 3.284.569.946] [~.ud 195.198.143.900]]]]
|
||||
as-of=[~ %as-of-offset 5 %days]
|
||||
==
|
||||
~
|
||||
~
|
||||
=/ urql "insert into db.ns.my-table ".
|
||||
"(col1, col2, col3, col4, col5, col6, col7, col8, col9 )".
|
||||
" values ('cord',.3.14,-20,20,.3.14,~nomryg-nilref,.-3.14, 'cor\\'d', --3)".
|
||||
" (default,.195.198.143.90, 195.198.143.900) as of 5 days ago"
|
||||
:: delete with one cte and predicate as of ~2023.12.25..7.15.0..1ef5
|
||||
++ test-delete-10
|
||||
=/ expected [%transform ctes=~[cte-t1] [[%delete table=foo-table delete-pred [~ ~2023.12.25..7.15.0..1ef5]] ~ ~]]
|
||||
%+ expect-eq
|
||||
!> ~[expected]
|
||||
!> (parse:parse(default-database 'other-db') urql)
|
||||
!> (parse:parse(default-database 'db1') "with (select *) as t1 delete from foo where foo=bar as of ~2023.12.25..7.15.0..1ef5")
|
||||
::
|
||||
:: every column type, no spaces around values
|
||||
++ test-insert-08
|
||||
=/ expected
|
||||
:+ %transform
|
||||
ctes=~
|
||||
:+ :* %insert
|
||||
table=[%qualified-object ship=~ database='db' namespace='ns' name='my-table']
|
||||
columns=~
|
||||
values=[%data ~[~[[~.t 1.685.221.219] [~.p 28.242.037] [~.p 28.242.037] [~.da 170.141.184.504.830.774.788.415.618.594.688.204.800] [~.da 170.141.184.504.830.774.788.415.618.594.688.204.800] [~.dr 114.450.695.119.985.999.668.576.256] [~.dr 114.450.695.119.985.999.668.576.256] [~.if 3.284.569.946] [~.is 123.543.654.234] [~.f 0] [~.f 1] [~.f 0] [~.f 1] [~.ud 2.222] [~.ud 2.222] [~.ud 195.198.143.900] [~.rs 1.078.523.331] [~.rs 3.226.006.979] [~.rd 4.614.253.070.214.989.087] [~.rd 13.837.625.107.069.764.895] [~.ux 1.205.249] [~.ub 43] [~.sd 39] [~.sd 40] [~.uw 61.764.130.813.526] [~.uw 1.870.418.170.505.042.572.886]]]]
|
||||
as-of=~
|
||||
==
|
||||
~
|
||||
~
|
||||
=/ urql "insert into db.ns.my-table ".
|
||||
"values ('cord',~nomryg-nilref,nomryg-nilref,~2020.12.25..7.15.0..1ef5,2020.12.25..7.15.0..1ef5,".
|
||||
"~d71.h19.m26.s24..9d55, d71.h19.m26.s24..9d55,.195.198.143.90,.0.0.0.0.0.1c.c3c6.8f5a,y,n,Y,N,".
|
||||
"2.222,2222,195.198.143.900,.3.14,.-3.14,~3.14,~-3.14,0x12.6401,10.1011,-20,--20,e2O.l4Xpm,pm.l4e2O.l4Xpm)"
|
||||
:: delete with one cte and predicate as of 5 seconds ago
|
||||
++ test-delete-11
|
||||
=/ expected [%transform ctes=~[cte-t1] [[%delete table=foo-table delete-pred [~ [%as-of-offset 5 %seconds]]] ~ ~]]
|
||||
%+ expect-eq
|
||||
!> ~[expected]
|
||||
!> (parse:parse(default-database 'db1') urql)
|
||||
!> (parse:parse(default-database 'db1') "with (select *) as t1 delete from foo where foo=bar as of 5 seconds ago")
|
||||
::
|
||||
:: every column type, spaces on all sides of values, comma inside cord
|
||||
++ test-insert-09
|
||||
=/ expected
|
||||
:+ %transform
|
||||
ctes=~
|
||||
:+ :* %insert
|
||||
table=[%qualified-object ship=~ database='db' namespace='ns' name='my-table']
|
||||
columns=~
|
||||
values=[%data ~[~[[~.t 430.242.426.723] [~.p 28.242.037] [~.p 28.242.037] [~.da 170.141.184.504.830.774.788.415.618.594.688.204.800] [~.da 170.141.184.504.830.774.788.415.618.594.688.204.800] [~.dr 114.450.695.119.985.999.668.576.256] [~.dr 114.450.695.119.985.999.668.576.256] [~.if 3.284.569.946] [~.is 123.543.654.234] [~.f 0] [~.f 1] [~.f 0] [~.f 1] [~.ud 2.222] [~.ud 2.222] [~.ud 195.198.143.900] [~.rs 1.078.523.331] [~.rs 3.226.006.979] [~.rd 4.614.253.070.214.989.087] [~.rd 13.837.625.107.069.764.895] [~.ux 1.205.249] [~.ub 43] [~.sd 39] [~.sd 40] [~.uw 61.764.130.813.526] [~.uw 1.870.418.170.505.042.572.886]]]]
|
||||
as-of=~
|
||||
==
|
||||
~
|
||||
~
|
||||
=/ urql "insert into db.ns.my-table ".
|
||||
"values ( 'cor,d' , ~nomryg-nilref , nomryg-nilref , ~2020.12.25..7.15.0..1ef5 , 2020.12.25..7.15.0..1ef5 , ".
|
||||
"~d71.h19.m26.s24..9d55 , d71.h19.m26.s24..9d55 , .195.198.143.90 , .0.0.0.0.0.1c.c3c6.8f5a , y , n , Y , N , ".
|
||||
"2.222 , 2222 , 195.198.143.900 , .3.14 , .-3.14 , ~3.14 , ~-3.14 , 0x12.6401 , 10.1011 , -20 , --20 , e2O.l4Xpm , pm.l4e2O.l4Xpm )"
|
||||
:: delete with two ctes and predicate
|
||||
++ test-delete-12
|
||||
=/ expected [%transform ctes=~[cte-t1 cte-foobar] [[%delete table=foo-table delete-pred ~] ~ ~]]
|
||||
%+ expect-eq
|
||||
!> ~[expected]
|
||||
!> (parse:parse(default-database 'db1') urql)
|
||||
|
||||
!> (parse:parse(default-database 'db1') "with (select *) as t1, (from foobar where col1=2 select col3, col4) as foobar delete from foo where foo=bar")
|
||||
::
|
||||
:: delete with two ctes and predicate as of now
|
||||
++ test-delete-13
|
||||
=/ expected [%transform ctes=~[cte-t1 cte-foobar] [[%delete table=foo-table delete-pred ~] ~ ~]]
|
||||
%+ expect-eq
|
||||
!> ~[expected]
|
||||
!> (parse:parse(default-database 'db1') "with (select *) as t1, (from foobar where col1=2 select col3, col4) as foobar delete from foo where foo=bar as of now")
|
||||
::
|
||||
:: delete with two ctes and predicate as of ~2023.12.25..7.15.0..1ef5
|
||||
++ test-delete-14
|
||||
=/ expected [%transform ctes=~[cte-t1 cte-foobar] [[%delete table=foo-table delete-pred [~ ~2023.12.25..7.15.0..1ef5]] ~ ~]]
|
||||
%+ expect-eq
|
||||
!> ~[expected]
|
||||
!> (parse:parse(default-database 'db1') "with (select *) as t1, (from foobar where col1=2 select col3, col4) as foobar delete from foo where foo=bar as of ~2023.12.25..7.15.0..1ef5")
|
||||
::
|
||||
:: delete with two ctes and predicate as of 5 seconds ago
|
||||
++ test-delete-15
|
||||
=/ expected [%transform ctes=~[cte-t1 cte-foobar] [[%delete table=foo-table delete-pred [~ [%as-of-offset 5 %seconds]]] ~ ~]]
|
||||
%+ expect-eq
|
||||
!> ~[expected]
|
||||
!> (parse:parse(default-database 'db1') "with (select *) as t1, (from foobar where col1=2 select col3, col4) as foobar delete from foo where foo=bar as of 5 seconds ago")
|
||||
::
|
||||
:: delete with three ctes and predicate
|
||||
++ test-delete-16
|
||||
=/ expected [%transform ctes=~[cte-t1 cte-foobar cte-bar] [%delete table=foo-table delete-pred ~] ~ ~]
|
||||
%+ expect-eq
|
||||
!> ~[expected]
|
||||
!> (parse:parse(default-database 'db1') "with (select *) as t1, (from foobar where col1=2 select col3, col4) as foobar, (from bar where col1=col2 select col2) as bar delete from foo where foo=bar")
|
||||
::
|
||||
:: delete with three ctes and predicate as of now
|
||||
++ test-delete-17
|
||||
=/ expected [%transform ctes=~[cte-t1 cte-foobar cte-bar] [%delete table=foo-table delete-pred ~] ~ ~]
|
||||
%+ expect-eq
|
||||
!> ~[expected]
|
||||
!> (parse:parse(default-database 'db1') "with (select *) as t1, (from foobar where col1=2 select col3, col4) as foobar, (from bar where col1=col2 select col2) as bar delete from foo where foo=bar as of now")
|
||||
::
|
||||
:: delete with three ctes and predicate as of ~2023.12.25..7.15.0..1ef5
|
||||
++ test-delete-18
|
||||
=/ expected [%transform ctes=~[cte-t1 cte-foobar cte-bar] [%delete table=foo-table delete-pred [~ ~2023.12.25..7.15.0..1ef5]] ~ ~]
|
||||
%+ expect-eq
|
||||
!> ~[expected]
|
||||
!> (parse:parse(default-database 'db1') "with (select *) as t1, (from foobar where col1=2 select col3, col4) as foobar, (from bar where col1=col2 select col2) as bar delete from foo where foo=bar as of ~2023.12.25..7.15.0..1ef5")
|
||||
::
|
||||
:: delete with three ctes and predicate as of 5 seconds ago
|
||||
++ test-delete-19
|
||||
=/ expected [%transform ctes=~[cte-t1 cte-foobar cte-bar] [%delete table=foo-table delete-pred [~ [%as-of-offset 5 %seconds]]] ~ ~]
|
||||
%+ expect-eq
|
||||
!> ~[expected]
|
||||
!> (parse:parse(default-database 'db1') "with (select *) as t1, (from foobar where col1=2 select col3, col4) as foobar, (from bar where col1=col2 select col2) as bar delete from foo where foo=bar as of 5 seconds ago")
|
||||
|
||||
::
|
||||
:: delete cte with no predicate
|
||||
++ test-delete-20
|
||||
=/ expected [%transform ctes=~[cte-t1] [[%delete table=foo-table ~ ~] ~ ~]]
|
||||
%+ expect-eq
|
||||
!> ~[expected]
|
||||
!> (parse:parse(default-database 'db1') "with (select *) as t1 delete from foo")
|
||||
::
|
||||
:: delete cte with no predicate as of now
|
||||
++ test-delete-21
|
||||
=/ expected [%transform ctes=~[cte-t1] [[%delete table=foo-table ~ ~] ~ ~]]
|
||||
%+ expect-eq
|
||||
!> ~[expected]
|
||||
!> (parse:parse(default-database 'db1') "with (select *) as t1 delete from foo as of now")
|
||||
::
|
||||
:: delete cte with no predicate as of ~2023.12.25..7.15.0..1ef5
|
||||
++ test-delete-22
|
||||
=/ expected [%transform ctes=~[cte-t1] [[%delete table=foo-table ~ [~ ~2023.12.25..7.15.0..1ef5]] ~ ~]]
|
||||
%+ expect-eq
|
||||
!> ~[expected]
|
||||
!> (parse:parse(default-database 'db1') "with (select *) as t1 delete from foo as of ~2023.12.25..7.15.0..1ef5")
|
||||
::
|
||||
:: delete cte with no predicate as of 5 seconds ago
|
||||
++ test-delete-23
|
||||
=/ expected [%transform ctes=~[cte-t1] [[%delete table=foo-table ~ [~ [%as-of-offset 5 %seconds]]] ~ ~]]
|
||||
%+ expect-eq
|
||||
!> ~[expected]
|
||||
!> (parse:parse(default-database 'db1') "with (select *) as t1 delete from foo as of 5 seconds ago")
|
||||
|
||||
|
||||
::@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||
::
|
||||
|
@ -706,48 +706,177 @@
|
||||
[%qualified-object ship=~ database='db1' namespace='dbo' name='foo']
|
||||
::
|
||||
:: delete from foo;delete foo
|
||||
++ test-delete-01
|
||||
++ test-delete-00
|
||||
=/ expected1 [%transform ctes=~ [[%delete table=foo-table ~ ~] ~ ~]]
|
||||
=/ expected2 [%transform ctes=~ [[%delete table=foo-table ~ ~] ~ ~]]
|
||||
%+ expect-eq
|
||||
!> ~[expected1 expected2]
|
||||
!> (parse:parse(default-database 'db1') "delete from foo;delete foo")
|
||||
::
|
||||
:: delete with predicate
|
||||
:: delete from foo as of now;delete foo as of now
|
||||
++ test-delete-01
|
||||
=/ expected1 [%transform ctes=~ [[%delete table=foo-table ~ ~] ~ ~]]
|
||||
=/ expected2 [%transform ctes=~ [[%delete table=foo-table ~ ~] ~ ~]]
|
||||
%+ expect-eq
|
||||
!> ~[expected1 expected2]
|
||||
!> (parse:parse(default-database 'db1') "delete from foo as of now;delete foo as of now")
|
||||
::
|
||||
:: delete from foo as of ~2023.12.25..7.15.0..1ef5;delete foo as of ~2023.12.25..7.15.0..1ef5
|
||||
++ test-delete-02
|
||||
=/ expected1 [%transform ctes=~ [[%delete table=foo-table ~ [~ ~2023.12.25..7.15.0..1ef5]] ~ ~]]
|
||||
=/ expected2 [%transform ctes=~ [[%delete table=foo-table ~ [~ ~2023.12.25..7.15.0..1ef5]] ~ ~]]
|
||||
%+ expect-eq
|
||||
!> ~[expected1 expected2]
|
||||
!> (parse:parse(default-database 'db1') "delete from foo as of 2023.12.25..7.15.0..1ef5;delete foo as of ~2023.12.25..7.15.0..1ef5")
|
||||
::
|
||||
:: delete from foo as of 5 seconds ago;delete foo as of 5 seconds ago
|
||||
++ test-delete-03
|
||||
=/ expected1 [%transform ctes=~ [[%delete table=foo-table ~ [~ [%as-of-offset 5 %seconds]]] ~ ~]]
|
||||
=/ expected2 [%transform ctes=~ [[%delete table=foo-table ~ [~ [%as-of-offset 4 %seconds]]] ~ ~]]
|
||||
%+ expect-eq
|
||||
!> ~[expected1 expected2]
|
||||
!> (parse:parse(default-database 'db1') "delete from foo as of 5 seconds ago;delete foo as of 4 seconds ago")
|
||||
::
|
||||
:: delete with predicate as
|
||||
++ test-delete-04
|
||||
=/ expected [%transform ctes=~ [[%delete table=foo-table delete-pred ~] ~ ~]]
|
||||
%+ expect-eq
|
||||
!> ~[expected]
|
||||
!> (parse:parse(default-database 'db1') "delete from foo where foo=bar")
|
||||
::
|
||||
:: delete with predicate of now
|
||||
++ test-delete-05
|
||||
=/ expected [%transform ctes=~ [[%delete table=foo-table delete-pred ~] ~ ~]]
|
||||
%+ expect-eq
|
||||
!> ~[expected]
|
||||
!> (parse:parse(default-database 'db1') "delete from foo where foo=bar as of now")
|
||||
::
|
||||
:: delete with predicate of ~2023.12.25..7.15.0..1ef5
|
||||
++ test-delete-06
|
||||
=/ expected [%transform ctes=~ [[%delete table=foo-table delete-pred [~ ~2023.12.25..7.15.0..1ef5]] ~ ~]]
|
||||
%+ expect-eq
|
||||
!> ~[expected]
|
||||
!> (parse:parse(default-database 'db1') "delete from foo where foo=bar as of ~2023.12.25..7.15.0..1ef5")
|
||||
::
|
||||
:: delete with predicate of 5 seconds ago
|
||||
++ test-delete-07
|
||||
=/ expected [%transform ctes=~ [[%delete table=foo-table delete-pred [~ [%as-of-offset 5 %seconds]]] ~ ~]]
|
||||
%+ expect-eq
|
||||
!> ~[expected]
|
||||
!> (parse:parse(default-database 'db1') "delete from foo where foo=bar as of 5 seconds ago")
|
||||
::
|
||||
:: delete with one cte and predicate
|
||||
++ test-delete-03
|
||||
++ test-delete-08
|
||||
=/ expected [%transform ctes=~[cte-t1] [[%delete table=foo-table delete-pred ~] ~ ~]]
|
||||
%+ expect-eq
|
||||
!> ~[expected]
|
||||
!> (parse:parse(default-database 'db1') "with (select *) as t1 delete from foo where foo=bar")
|
||||
::
|
||||
:: delete with one cte and predicate as of now
|
||||
++ test-delete-09
|
||||
=/ expected [%transform ctes=~[cte-t1] [[%delete table=foo-table delete-pred ~] ~ ~]]
|
||||
%+ expect-eq
|
||||
!> ~[expected]
|
||||
!> (parse:parse(default-database 'db1') "with (select *) as t1 delete from foo where foo=bar as of now")
|
||||
::
|
||||
:: delete with one cte and predicate as of ~2023.12.25..7.15.0..1ef5
|
||||
++ test-delete-10
|
||||
=/ expected [%transform ctes=~[cte-t1] [[%delete table=foo-table delete-pred [~ ~2023.12.25..7.15.0..1ef5]] ~ ~]]
|
||||
%+ expect-eq
|
||||
!> ~[expected]
|
||||
!> (parse:parse(default-database 'db1') "with (select *) as t1 delete from foo where foo=bar as of ~2023.12.25..7.15.0..1ef5")
|
||||
::
|
||||
:: delete with one cte and predicate as of 5 seconds ago
|
||||
++ test-delete-11
|
||||
=/ expected [%transform ctes=~[cte-t1] [[%delete table=foo-table delete-pred [~ [%as-of-offset 5 %seconds]]] ~ ~]]
|
||||
%+ expect-eq
|
||||
!> ~[expected]
|
||||
!> (parse:parse(default-database 'db1') "with (select *) as t1 delete from foo where foo=bar as of 5 seconds ago")
|
||||
::
|
||||
:: delete with two ctes and predicate
|
||||
++ test-delete-04
|
||||
++ test-delete-12
|
||||
=/ expected [%transform ctes=~[cte-t1 cte-foobar] [[%delete table=foo-table delete-pred ~] ~ ~]]
|
||||
%+ expect-eq
|
||||
!> ~[expected]
|
||||
!> (parse:parse(default-database 'db1') "with (select *) as t1, (from foobar where col1=2 select col3, col4) as foobar delete from foo where foo=bar")
|
||||
::
|
||||
:: delete with two ctes and predicate as of now
|
||||
++ test-delete-13
|
||||
=/ expected [%transform ctes=~[cte-t1 cte-foobar] [[%delete table=foo-table delete-pred ~] ~ ~]]
|
||||
%+ expect-eq
|
||||
!> ~[expected]
|
||||
!> (parse:parse(default-database 'db1') "with (select *) as t1, (from foobar where col1=2 select col3, col4) as foobar delete from foo where foo=bar as of now")
|
||||
::
|
||||
:: delete with two ctes and predicate as of ~2023.12.25..7.15.0..1ef5
|
||||
++ test-delete-14
|
||||
=/ expected [%transform ctes=~[cte-t1 cte-foobar] [[%delete table=foo-table delete-pred [~ ~2023.12.25..7.15.0..1ef5]] ~ ~]]
|
||||
%+ expect-eq
|
||||
!> ~[expected]
|
||||
!> (parse:parse(default-database 'db1') "with (select *) as t1, (from foobar where col1=2 select col3, col4) as foobar delete from foo where foo=bar as of ~2023.12.25..7.15.0..1ef5")
|
||||
::
|
||||
:: delete with two ctes and predicate as of 5 seconds ago
|
||||
++ test-delete-15
|
||||
=/ expected [%transform ctes=~[cte-t1 cte-foobar] [[%delete table=foo-table delete-pred [~ [%as-of-offset 5 %seconds]]] ~ ~]]
|
||||
%+ expect-eq
|
||||
!> ~[expected]
|
||||
!> (parse:parse(default-database 'db1') "with (select *) as t1, (from foobar where col1=2 select col3, col4) as foobar delete from foo where foo=bar as of 5 seconds ago")
|
||||
::
|
||||
:: delete with three ctes and predicate
|
||||
++ test-delete-05
|
||||
++ test-delete-16
|
||||
=/ expected [%transform ctes=~[cte-t1 cte-foobar cte-bar] [%delete table=foo-table delete-pred ~] ~ ~]
|
||||
%+ expect-eq
|
||||
!> ~[expected]
|
||||
!> (parse:parse(default-database 'db1') "with (select *) as t1, (from foobar where col1=2 select col3, col4) as foobar, (from bar where col1=col2 select col2) as bar delete from foo where foo=bar")
|
||||
::
|
||||
:: delete with three ctes and predicate as of now
|
||||
++ test-delete-17
|
||||
=/ expected [%transform ctes=~[cte-t1 cte-foobar cte-bar] [%delete table=foo-table delete-pred ~] ~ ~]
|
||||
%+ expect-eq
|
||||
!> ~[expected]
|
||||
!> (parse:parse(default-database 'db1') "with (select *) as t1, (from foobar where col1=2 select col3, col4) as foobar, (from bar where col1=col2 select col2) as bar delete from foo where foo=bar as of now")
|
||||
::
|
||||
:: delete with three ctes and predicate as of ~2023.12.25..7.15.0..1ef5
|
||||
++ test-delete-18
|
||||
=/ expected [%transform ctes=~[cte-t1 cte-foobar cte-bar] [%delete table=foo-table delete-pred [~ ~2023.12.25..7.15.0..1ef5]] ~ ~]
|
||||
%+ expect-eq
|
||||
!> ~[expected]
|
||||
!> (parse:parse(default-database 'db1') "with (select *) as t1, (from foobar where col1=2 select col3, col4) as foobar, (from bar where col1=col2 select col2) as bar delete from foo where foo=bar as of ~2023.12.25..7.15.0..1ef5")
|
||||
::
|
||||
:: delete with three ctes and predicate as of 5 seconds ago
|
||||
++ test-delete-19
|
||||
=/ expected [%transform ctes=~[cte-t1 cte-foobar cte-bar] [%delete table=foo-table delete-pred [~ [%as-of-offset 5 %seconds]]] ~ ~]
|
||||
%+ expect-eq
|
||||
!> ~[expected]
|
||||
!> (parse:parse(default-database 'db1') "with (select *) as t1, (from foobar where col1=2 select col3, col4) as foobar, (from bar where col1=col2 select col2) as bar delete from foo where foo=bar as of 5 seconds ago")
|
||||
::
|
||||
:: delete cte with no predicate
|
||||
++ test-delete-06
|
||||
++ test-delete-20
|
||||
=/ expected [%transform ctes=~[cte-t1] [[%delete table=foo-table ~ ~] ~ ~]]
|
||||
%+ expect-eq
|
||||
!> ~[expected]
|
||||
!> (parse:parse(default-database 'db1') "with (select *) as t1 delete from foo")
|
||||
::
|
||||
:: delete cte with no predicate as of now
|
||||
++ test-delete-21
|
||||
=/ expected [%transform ctes=~[cte-t1] [[%delete table=foo-table ~ ~] ~ ~]]
|
||||
%+ expect-eq
|
||||
!> ~[expected]
|
||||
!> (parse:parse(default-database 'db1') "with (select *) as t1 delete from foo as of now")
|
||||
::
|
||||
:: delete cte with no predicate as of ~2023.12.25..7.15.0..1ef5
|
||||
++ test-delete-22
|
||||
=/ expected [%transform ctes=~[cte-t1] [[%delete table=foo-table ~ [~ ~2023.12.25..7.15.0..1ef5]] ~ ~]]
|
||||
%+ expect-eq
|
||||
!> ~[expected]
|
||||
!> (parse:parse(default-database 'db1') "with (select *) as t1 delete from foo as of ~2023.12.25..7.15.0..1ef5")
|
||||
::
|
||||
:: delete cte with no predicate as of 5 seconds ago
|
||||
++ test-delete-23
|
||||
=/ expected [%transform ctes=~[cte-t1] [[%delete table=foo-table ~ [~ [%as-of-offset 5 %seconds]]] ~ ~]]
|
||||
%+ expect-eq
|
||||
!> ~[expected]
|
||||
!> (parse:parse(default-database 'db1') "with (select *) as t1 delete from foo as of 5 seconds ago")
|
||||
::
|
||||
:: drop database
|
||||
::
|
||||
:: tests 1, 2, 3, 5, and extra whitespace characters, force db.name, name
|
||||
|
Loading…
Reference in New Issue
Block a user