comparison PostgreSQL/UnitTests/PostgreSQLTests.cpp @ 266:cc7af42d4f23

Store revisions for metadata and attachments in PostgreSQL
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 20 Apr 2021 17:41:44 +0200
parents d663d9e44f8d
children 16aac0287485
comparison
equal deleted inserted replaced
265:cd73e34d5411 266:cc7af42d4f23
84 TEST(PostgreSQL, Basic) 84 TEST(PostgreSQL, Basic)
85 { 85 {
86 std::unique_ptr<PostgreSQLDatabase> pg(CreateTestDatabase()); 86 std::unique_ptr<PostgreSQLDatabase> pg(CreateTestDatabase());
87 87
88 ASSERT_FALSE(pg->DoesTableExist("Test")); 88 ASSERT_FALSE(pg->DoesTableExist("Test"));
89 ASSERT_FALSE(pg->DoesColumnExist("Test", "value"));
90 ASSERT_FALSE(pg->DoesTableExist("TEST"));
91 ASSERT_FALSE(pg->DoesTableExist("test"));
89 pg->ExecuteMultiLines("CREATE TABLE Test(name INTEGER, value BIGINT)"); 92 pg->ExecuteMultiLines("CREATE TABLE Test(name INTEGER, value BIGINT)");
90 ASSERT_TRUE(pg->DoesTableExist("Test")); 93 ASSERT_TRUE(pg->DoesTableExist("Test"));
91 94 ASSERT_TRUE(pg->DoesTableExist("TEST"));
95 ASSERT_TRUE(pg->DoesTableExist("test"));
96
97 ASSERT_TRUE(pg->DoesColumnExist("Test", "Value"));
98 ASSERT_TRUE(pg->DoesColumnExist("TEST", "VALUE"));
99 ASSERT_TRUE(pg->DoesColumnExist("test", "value"));
100
92 PostgreSQLStatement s(*pg, "INSERT INTO Test VALUES ($1,$2)"); 101 PostgreSQLStatement s(*pg, "INSERT INTO Test VALUES ($1,$2)");
93 s.DeclareInputInteger(0); 102 s.DeclareInputInteger(0);
94 s.DeclareInputInteger64(1); 103 s.DeclareInputInteger64(1);
95 104
96 s.BindInteger(0, 43); 105 s.BindInteger(0, 43);