Class: Aspera::Sync::Database
- Inherits:
-
Object
- Object
- Aspera::Sync::Database
- Defined in:
- lib/aspera/sync/database.rb
Instance Method Summary collapse
- #counters ⇒ Object
- #file_info ⇒ Object
-
#initialize(db_path) ⇒ Database
constructor
A new instance of Database.
- #meta ⇒ Object
- #overview ⇒ Object
Constructor Details
#initialize(db_path) ⇒ Database
Returns a new instance of Database.
56 57 58 |
# File 'lib/aspera/sync/database.rb', line 56 def initialize(db_path) @db = SqLite3Wrapper.new(db_path) end |
Instance Method Details
#counters ⇒ Object
74 75 76 |
# File 'lib/aspera/sync/database.rb', line 74 def counters @db.single_table('sync_snap_counters_table') end |
#file_info ⇒ Object
78 79 80 |
# File 'lib/aspera/sync/database.rb', line 78 def file_info @db.full_table('sync_snapdb_table') end |
#meta ⇒ Object
70 71 72 |
# File 'lib/aspera/sync/database.rb', line 70 def @db.single_table('sync_snapmeta_table') end |
#overview ⇒ Object
60 61 62 63 64 65 66 67 68 |
# File 'lib/aspera/sync/database.rb', line 60 def overview tables = @db.execute("SELECT name FROM sqlite_master WHERE type='table';") tables.flat_map do |table_row| table_name = table_row['name'] @db.execute("PRAGMA table_info(#{table_name});").map do |col| {'table' => table_name}.merge(col) end end end |