feat: 🚧 begin work on a proper Timeseries table
This commit is contained in:
parent
3d15464521
commit
2e74de359c
3 changed files with 47 additions and 0 deletions
|
@ -2,6 +2,7 @@
|
|||
require 'pg'
|
||||
|
||||
require_relative 'CachingTable.rb'
|
||||
require_relative 'TimeseriesTable.rb'
|
||||
|
||||
module Timeseries
|
||||
module Hoarder
|
||||
|
@ -18,6 +19,14 @@ module Timeseries
|
|||
@pg.exec("CREATE SCHEMA IF NOT EXISTS ts_hoarder")
|
||||
|
||||
@data_sources = CachingTable.new(self, 'sources', 'source')
|
||||
|
||||
@series = {}
|
||||
end
|
||||
|
||||
def add_timeseries(name, **opts)
|
||||
return @series[name] if @series.include? name
|
||||
|
||||
new_series = SeriesTable.new(self, name, **opts)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue