2023-10-21 17:04:17 +00:00
|
|
|
my_table = table <text number bool> [
|
2023-10-19 02:27:57 +00:00
|
|
|
["a", 1, true]
|
|
|
|
["b", 2, true]
|
|
|
|
["a", 3, true]
|
|
|
|
]
|
2023-10-06 12:17:37 +00:00
|
|
|
|
2023-10-21 17:04:17 +00:00
|
|
|
test_table = table <text bool> [
|
2023-10-19 02:27:57 +00:00
|
|
|
["a", true]
|
|
|
|
["b", true]
|
|
|
|
["a", true]
|
|
|
|
]
|
2023-10-06 12:17:37 +00:00
|
|
|
|
2023-10-21 17:04:17 +00:00
|
|
|
test_select = select <text bool> from my_table
|
2023-10-06 12:17:37 +00:00
|
|
|
|
2023-10-21 17:04:17 +00:00
|
|
|
(assert_equal test_select, test_table)
|
2023-10-06 12:17:37 +00:00
|
|
|
|
2023-10-21 17:04:17 +00:00
|
|
|
test_table = table <text number bool> [
|
2023-10-22 17:55:56 +00:00
|
|
|
[1, true]
|
|
|
|
[3, true]
|
2023-10-19 02:27:57 +00:00
|
|
|
]
|
|
|
|
|
2023-10-22 17:55:56 +00:00
|
|
|
test_select_where = select <number, bool> from my_table {
|
2023-10-21 17:04:17 +00:00
|
|
|
text == "a"
|
|
|
|
}
|
2023-10-19 02:27:57 +00:00
|
|
|
|
2023-10-21 17:04:17 +00:00
|
|
|
(assert_equal test_select_where, test_table)
|
2023-10-22 17:55:56 +00:00
|
|
|
|
|
|
|
test_table = table <text number bool> [
|
|
|
|
["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)
|