Skip to content

Commit 61eb04b

Browse files
committed
added static assertion
1 parent 77f401a commit 61eb04b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/node_sqlite.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ inline constexpr std::array<LimitInfo, 11> kLimitMapping = {{
3939
{"triggerDepth", SQLITE_LIMIT_TRIGGER_DEPTH},
4040
}};
4141

42-
// Static assertion to ensure all limit IDs fit in the array
42+
// Static assertions to ensure limit mapping is complete and valid
43+
static_assert(kLimitMapping.size() == SQLITE_LIMIT_TRIGGER_DEPTH + 1,
44+
"kLimitMapping must cover all SQLite limits");
45+
4346
constexpr bool CheckLimitBounds() {
4447
for (const auto& info : kLimitMapping) {
4548
if (info.sqlite_limit_id < 0 ||

0 commit comments

Comments
 (0)