You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
expected_sql="SELECT name FROM `marine_mammals`.`walrus`"
self.assertEqual(
expected_sql,
self.compiler.compile(
Select(
["name"],
TableName(("marine_mammals", "walrus")),
)
),
)
deftest_enum(self):
expected_sql="(SELECT *, (row_number() over (ORDER BY id)) as idx FROM `walrus` ORDER BY id) tmp"
self.assertEqual(
expected_sql,
self.compiler.compile(
Enum(
("walrus",),
"id",
)
),
)
# def test_checksum(self):
# expected_sql = "SELECT name, sum(cast(conv(substring(md5(concat(cast(id as char), cast(timestamp as char))), 18), 16, 10) as unsigned)) FROM `marine_mammals`.`walrus`"
# self.assertEqual(
# expected_sql,
# self.compiler.compile(
# Select(
# ["name", Checksum(["id", "timestamp"])],
# TableName(("marine_mammals", "walrus")),
# )
# ),
# )
deftest_compare(self):
expected_sql="SELECT name FROM `marine_mammals`.`walrus` WHERE (id <= 1000) AND (id > 1)"