Skip to content

Commit 3416f1a

Browse files
committed
Compile support for SQLITE_DBPAGE
https://www.sqlite.org/dbpage.html
1 parent c0f6df8 commit 3416f1a

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

ext/sqlite3/extconf.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ def configure_packaged_libraries
6262
"-O2", # see https://github.com/sparklemotion/sqlite3-ruby/issues/335 for some benchmarks
6363
"-fvisibility=hidden", # see https://github.com/rake-compiler/rake-compiler-dock/issues/87
6464
"-DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1",
65-
"-DSQLITE_USE_URI=1"
65+
"-DSQLITE_USE_URI=1",
66+
"-DSQLITE_ENABLE_DBPAGE_VTAB=1"
6667
]
6768
env["CFLAGS"] = [user_cflags, env["CFLAGS"], more_cflags].flatten.join(" ")
6869
recipe.configure_options += env.select { |k, v| ENV_ALLOWLIST.include?(k) }

test/test_database.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -721,5 +721,11 @@ def test_transaction_returns_block_result
721721
result = @db.transaction { :foo }
722722
assert_equal :foo, result
723723
end
724+
725+
def test_sqlite_dbpage_vtab
726+
skip("sqlite_dbpage not supported") unless SQLite3::SQLITE_PACKAGED_LIBRARIES
727+
728+
assert_nothing_raised { @db.execute("select count(*) from sqlite_dbpage") }
729+
end
724730
end
725731
end

0 commit comments

Comments
 (0)