Module: Litesupport::Liteconnection
- Includes:
- Forkable
- Included in:
- Litecable, Litecache, Litemetric, Litemetric::Collector, Litequeue
- Defined in:
- lib/litestack/litesupport.rb
Instance Method Summary collapse
- #close ⇒ Object
- #journal_mode ⇒ Object
-
#options ⇒ Object
close, setup, run_stmt and run_sql assume a single connection was created.
- #path ⇒ Object
- #size ⇒ Object
- #synchronous ⇒ Object
Methods included from Forkable
Instance Method Details
#close ⇒ Object
136 137 138 139 140 141 142 |
# File 'lib/litestack/litesupport.rb', line 136 def close @running = false @conn.acquire do |q| q.stmts.each_pair { |k, v| q.stmts[k].close } q.close end end |
#journal_mode ⇒ Object
148 149 150 |
# File 'lib/litestack/litesupport.rb', line 148 def journal_mode run_method(:journal_mode) end |
#options ⇒ Object
close, setup, run_stmt and run_sql assume a single connection was created
132 133 134 |
# File 'lib/litestack/litesupport.rb', line 132 def @options end |
#path ⇒ Object
156 157 158 |
# File 'lib/litestack/litesupport.rb', line 156 def path run_method(:filename) end |
#size ⇒ Object
144 145 146 |
# File 'lib/litestack/litesupport.rb', line 144 def size run_sql("SELECT size.page_size * count.page_count FROM pragma_page_size() AS size, pragma_page_count() AS count")[0][0].to_f / (1024 * 1024) end |
#synchronous ⇒ Object
152 153 154 |
# File 'lib/litestack/litesupport.rb', line 152 def synchronous run_method(:synchronous) end |