Skip to content

Commit

Permalink
Add convenience wrapper for pragma optimize
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcwatt committed Oct 29, 2024
1 parent 2d0139d commit 29840dd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/sqlite3/pragmas.rb
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,14 @@ def mmap_size=(size)
set_int_pragma "mmap_size", size
end

def optimize(bitmask = nil)
if bitmask
set_int_pragma "optimize", bitmask
else
execute("PRAGMA optimize")
end
end

def page_count
get_int_pragma "page_count"
end
Expand Down

0 comments on commit 29840dd

Please sign in to comment.