2023-11-03 18:04:45 -04:00
|
|
|
my_table = table |text number bool| [
|
2023-10-18 22:27:57 -04:00
|
|
|
["a", 1, true]
|
|
|
|
["b", 2, true]
|
|
|
|
["a", 3, true]
|
|
|
|
]
|
2023-10-06 08:17:37 -04:00
|
|
|
|
2023-11-03 18:04:45 -04:00
|
|
|
test_table = table |text bool| [
|
2023-10-18 22:27:57 -04:00
|
|
|
["a", true]
|
|
|
|
["b", true]
|
|
|
|
["a", true]
|
|
|
|
]
|
2023-10-06 08:17:37 -04:00
|
|
|
|
2023-11-04 06:02:27 -04:00
|
|
|
test_select = select |text bool| from my_table;
|
2023-10-06 08:17:37 -04:00
|
|
|
|
2023-10-21 13:04:17 -04:00
|
|
|
(assert_equal test_select, test_table)
|
2023-10-06 08:17:37 -04:00
|
|
|
|
2023-11-04 06:02:27 -04:00
|
|
|
test_table = table |number bool| [
|
2023-10-22 13:55:56 -04:00
|
|
|
[1, true]
|
|
|
|
[3, true]
|
2023-10-18 22:27:57 -04:00
|
|
|
]
|
|
|
|
|
2023-11-03 18:04:45 -04:00
|
|
|
test_select_where = select |number, bool| from my_table {
|
2023-10-21 13:04:17 -04:00
|
|
|
text == "a"
|
|
|
|
}
|
2023-10-18 22:27:57 -04:00
|
|
|
|
2023-10-21 13:04:17 -04:00
|
|
|
(assert_equal test_select_where, test_table)
|
2023-10-22 13:55:56 -04:00
|
|
|
|
2023-11-03 18:04:45 -04:00
|
|
|
test_table = table |text number bool| [
|
2023-10-22 13:55:56 -04:00
|
|
|
["a", 1, true]
|
|
|
|
["b", 2, true]
|
|
|
|
["a", 3, true]
|
|
|
|
["c", 4, true]
|
|
|
|
["d", 5, true]
|
|
|
|
["e", 6, true]
|
|
|
|
]
|
|
|
|
|
|
|
|
insert into my_table [
|
|
|
|
["c", 4, true]
|
|
|
|
["d", 5, true]
|
|
|
|
["e", 6, true]
|
|
|
|
]
|
|
|
|
|
|
|
|
(assert_equal test_table, my_table)
|