Skip to content

Commit 301326c

Browse files
[tests] SqlDataDiffTests: connect via {SQLite3 ODBC Driver} on both platforms
Aligns the helper with the canonical test-env string used everywhere else: CI's odbcinst.ini rename gives both platforms a single entry named `SQLite3 ODBC Driver`, so the previous Linux-only `SQLite3` fallback misses on the rebased CI image. Signed-off-by: Christian Parpart <christian@parpart.family>
1 parent fa974c8 commit 301326c

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

src/tests/SqlDataDiffTests.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,12 @@ struct ScopedTempFile
4343

4444
[[nodiscard]] SqlConnectionString SqliteConn(std::filesystem::path const& path)
4545
{
46-
// The Windows ODBC driver name has spaces and must be wrapped in braces; the
47-
// unixODBC convention used on Linux/macOS keeps a bare identifier.
48-
#if defined(_WIN32) || defined(_WIN64)
49-
constexpr auto driverName = "{SQLite3 ODBC Driver}";
50-
#else
51-
constexpr auto driverName = "SQLite3";
52-
#endif
53-
return SqlConnectionString { std::format("DRIVER={};Database={}", driverName, path.string()) };
46+
// CI registers the SQLite ODBC driver under `[SQLite3 ODBC Driver]` on both
47+
// Linux (after the workflow renames the libsqliteodbc default `[SQLite3]`
48+
// entry) and Windows. The braces are mandatory because the driver name
49+
// contains spaces. Local developers whose `/etc/odbcinst.ini` keeps the
50+
// bare `[SQLite3]` entry must follow the same rename.
51+
return SqlConnectionString { std::format("Driver={{SQLite3 ODBC Driver}};Database={}", path.string()) };
5452
}
5553

5654
/// Creates a `users(id PK, name, email)` table and inserts the given rows.

0 commit comments

Comments
 (0)