Sha256: 0e9d02e68dbd260a8eb4e01f63502005f69afa84c3f54bac00e255644cbfa416

Contents?: true

Size: 385 Bytes

Versions: 4

Compression:

Stored size: 385 Bytes

Contents

require "fast_sqlite/version"
require 'sqlite3'

SQLite3::Database.class_eval do
  alias_method :initialize_original, :initialize
  def initialize(*args)
    initialize_original(*args)
    gotta_go_fast!

    if block_given?
      yield(self)
      close
    end
  end

  def gotta_go_fast!
    execute('PRAGMA synchronous = OFF')
    execute('PRAGMA journal_mode = MEMORY')
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
solidus_backend-1.0.0.pre3 vendor/bundle/gems/fast_sqlite-0.0.1/lib/fast_sqlite.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/fast_sqlite-0.0.1/lib/fast_sqlite.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/fast_sqlite-0.0.1/lib/fast_sqlite.rb
fast_sqlite-0.0.1 lib/fast_sqlite.rb