2018-12-05 09:35:50 +00:00
|
|
|
// dbx.v1 golang satellitedb.dbx .
|
|
|
|
|
2018-12-14 14:27:21 +00:00
|
|
|
//--- bwagreement ---//
|
|
|
|
|
2018-12-07 09:59:31 +00:00
|
|
|
model bwagreement (
|
|
|
|
key signature
|
2018-12-05 09:35:50 +00:00
|
|
|
|
2018-12-07 09:59:31 +00:00
|
|
|
field signature blob
|
|
|
|
|
|
|
|
field data blob
|
|
|
|
|
|
|
|
field created_at timestamp ( autoinsert )
|
|
|
|
)
|
|
|
|
|
|
|
|
create bwagreement ( )
|
|
|
|
delete bwagreement ( where bwagreement.signature = ? )
|
|
|
|
read one (
|
|
|
|
select bwagreement
|
|
|
|
where bwagreement.signature = ?
|
|
|
|
)
|
|
|
|
read limitoffset (
|
|
|
|
select bwagreement
|
|
|
|
)
|
|
|
|
read all (
|
|
|
|
select bwagreement
|
|
|
|
)
|
|
|
|
read all (
|
|
|
|
select bwagreement
|
|
|
|
where bwagreement.created_at > ?
|
2018-12-10 19:08:45 +00:00
|
|
|
)
|
|
|
|
|
2018-12-14 14:27:21 +00:00
|
|
|
//--- datarepair.irreparableDB ---//
|
|
|
|
|
2018-12-10 19:08:45 +00:00
|
|
|
model irreparabledb (
|
|
|
|
key segmentpath
|
|
|
|
|
|
|
|
field segmentpath blob
|
|
|
|
field segmentdetail blob (updatable)
|
|
|
|
field pieces_lost_count int64 (updatable)
|
|
|
|
field seg_damaged_unix_sec int64 (updatable)
|
|
|
|
field repair_attempt_count int64 (updatable)
|
|
|
|
)
|
|
|
|
|
|
|
|
create irreparabledb ( )
|
|
|
|
update irreparabledb ( where irreparabledb.segmentpath = ? )
|
|
|
|
delete irreparabledb ( where irreparabledb.segmentpath = ? )
|
|
|
|
read one (
|
|
|
|
select irreparabledb
|
|
|
|
where irreparabledb.segmentpath = ?
|
2018-12-14 14:27:21 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
//--- accounting ---//
|
|
|
|
|
|
|
|
// timestamps just allows us to save the last time/thing that happened
|
|
|
|
model timestamps (
|
|
|
|
key name
|
|
|
|
|
|
|
|
field name text
|
|
|
|
field value timestamp ( updatable )
|
|
|
|
)
|
|
|
|
create timestamps ( )
|
|
|
|
update timestamps ( where timestamps.name = ? )
|
|
|
|
read scalar (
|
|
|
|
select timestamps.value
|
|
|
|
where timestamps.name = ?
|
|
|
|
)
|
|
|
|
|
|
|
|
model rollup (
|
|
|
|
key id
|
|
|
|
|
|
|
|
field id serial64
|
|
|
|
field node_id text
|
|
|
|
field start_time timestamp
|
|
|
|
field interval int64
|
|
|
|
field data_type int
|
|
|
|
field created_at timestamp ( autoinsert )
|
|
|
|
field updated_at timestamp ( autoinsert, autoupdate )
|
|
|
|
)
|
|
|
|
|
|
|
|
create rollup ( )
|
|
|
|
update rollup ( where rollup.id = ? )
|
|
|
|
delete rollup ( where rollup.id = ? )
|
|
|
|
read one (
|
|
|
|
select rollup
|
|
|
|
where rollup.id = ?
|
|
|
|
)
|
|
|
|
read all (
|
|
|
|
select rollup
|
|
|
|
where rollup.node_id = ?
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
model raw (
|
|
|
|
key id
|
|
|
|
|
|
|
|
field id serial64
|
|
|
|
field node_id text
|
|
|
|
field interval_end_time timestamp
|
|
|
|
field data_total int64
|
|
|
|
field data_type int
|
|
|
|
field created_at timestamp ( autoinsert )
|
|
|
|
field updated_at timestamp ( autoinsert, autoupdate )
|
|
|
|
)
|
|
|
|
|
|
|
|
create raw ( )
|
|
|
|
update raw ( where raw.id = ? )
|
|
|
|
delete raw ( where raw.id = ? )
|
|
|
|
read one (
|
|
|
|
select raw
|
|
|
|
where raw.id = ?
|
|
|
|
)
|
|
|
|
read all (
|
|
|
|
select raw
|
|
|
|
where raw.node_id = ?
|
2018-12-14 20:17:30 +00:00
|
|
|
)
|
|
|
|
// dbx.v1 golang statdb.dbx .
|
|
|
|
model node (
|
|
|
|
key id
|
|
|
|
|
|
|
|
field id blob
|
|
|
|
field audit_success_count int64 (updatable)
|
|
|
|
field total_audit_count int64 (updatable)
|
|
|
|
field audit_success_ratio float64 (updatable)
|
|
|
|
|
|
|
|
field uptime_success_count int64 (updatable)
|
|
|
|
field total_uptime_count int64 (updatable)
|
|
|
|
field uptime_ratio float64 (updatable)
|
|
|
|
|
|
|
|
field created_at timestamp ( autoinsert )
|
|
|
|
field updated_at timestamp ( autoinsert, autoupdate )
|
|
|
|
)
|
|
|
|
|
|
|
|
create node ( )
|
|
|
|
update node ( where node.id = ? )
|
|
|
|
delete node ( where node.id = ? )
|
|
|
|
read one (
|
|
|
|
select node
|
|
|
|
where node.id = ?
|
|
|
|
)
|