Class: Rack::WebProfiler::Model

Inherits:
Object
  • Object
show all
Defined in:
lib/rack/web_profiler/model.rb

Overview

Model

Defined Under Namespace

Classes: CollectionRecord

Class Method Summary collapse

Class Method Details

.clean!Object

Remove the database content.



22
23
24
25
26
27
28
# File 'lib/rack/web_profiler/model.rb', line 22

def clean!
  return unless ::File.exist?(db_file_path)

  ::File.delete(db_file_path)
  @db = nil
  @db_file_path = nil
end

.databaseSequel::SQLite::Database

Get the WebProfiler database.

Returns:

  • (Sequel::SQLite::Database)


11
12
13
14
15
16
17
18
19
# File 'lib/rack/web_profiler/model.rb', line 11

def database
  @db ||= Sequel.connect("sqlite://#{db_file_path}", {
    single_threaded: true,
    # timeout: 5000,
    # # single_threaded: true, # = mieux
    # pool_timeout: 5000,
    # max_connections: 1,
  })
end