mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:17:45 +00:00
LibSQL: Add an INSERT without column names test
This adds a passing test of an insert statement that contains no column names and assumes full tuple input
This commit is contained in:
parent
235573f7ba
commit
0e5b2c923d
1 changed files with 13 additions and 0 deletions
|
@ -114,6 +114,19 @@ TEST_CASE(insert_wrong_number_of_values)
|
||||||
EXPECT(result->inserted() == 0);
|
EXPECT(result->inserted() == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_CASE(insert_without_column_names)
|
||||||
|
{
|
||||||
|
ScopeGuard guard([]() { unlink(db_name); });
|
||||||
|
auto database = SQL::Database::construct(db_name);
|
||||||
|
create_table(database);
|
||||||
|
auto result = execute(database, "INSERT INTO TestSchema.TestTable VALUES ('Test_1', 42), ('Test_2', 43);");
|
||||||
|
EXPECT(result->error().code == SQL::SQLErrorCode::NoError);
|
||||||
|
EXPECT(result->inserted() == 2);
|
||||||
|
|
||||||
|
auto table = database->get_table("TESTSCHEMA", "TESTTABLE");
|
||||||
|
EXPECT_EQ(database->select_all(*table).size(), 2u);
|
||||||
|
}
|
||||||
|
|
||||||
TEST_CASE(select_from_table)
|
TEST_CASE(select_from_table)
|
||||||
{
|
{
|
||||||
ScopeGuard guard([]() { unlink(db_name); });
|
ScopeGuard guard([]() { unlink(db_name); });
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue