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
135 136 137 138 139 140 141 |
# File 'lib/litestack/litesupport.rb', line 135 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
147 148 149 |
# File 'lib/litestack/litesupport.rb', line 147 def journal_mode run_method(:journal_mode) end |
#options ⇒ Object
close, setup, run_stmt and run_sql assume a single connection was created
131 132 133 |
# File 'lib/litestack/litesupport.rb', line 131 def end |
#path ⇒ Object
155 156 157 |
# File 'lib/litestack/litesupport.rb', line 155 def path run_method(:filename) end |
#size ⇒ Object
143 144 145 |
# File 'lib/litestack/litesupport.rb', line 143 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
151 152 153 |
# File 'lib/litestack/litesupport.rb', line 151 def synchronous run_method(:synchronous) end |