tangled
alpha
login
or
join now
atscan.net
/
atscand
1
fork
atom
wip
1
fork
atom
overview
issues
pulls
pipelines
update
tree.fail
5 months ago
b194d119
ac372fce
+10
-4
1 changed file
expand all
collapse all
unified
split
internal
storage
sqlite.go
+10
-4
internal/storage/sqlite.go
···
421
421
func (s *SQLiteDB) GetBundles(ctx context.Context, limit int) ([]*PLCBundle, error) {
422
422
query := `
423
423
SELECT bundle_number, start_time, end_time, dids, hash, compressed_hash,
424
424
-
compressed_size, uncompressed_size, cursor, prev_bundle_hash, compressed, created_at
424
424
+
compressed_size, uncompressed_size, cumulative_compressed_size,
425
425
+
cumulative_uncompressed_size, cursor, prev_bundle_hash, compressed, created_at
425
426
FROM plc_bundles
426
427
ORDER BY bundle_number DESC
427
428
LIMIT ?
···
440
441
func (s *SQLiteDB) GetBundlesForDID(ctx context.Context, did string) ([]*PLCBundle, error) {
441
442
query := `
442
443
SELECT bundle_number, start_time, end_time, dids, hash, compressed_hash,
443
443
-
compressed_size, uncompressed_size, cursor, prev_bundle_hash, compressed, created_at
444
444
+
compressed_size, uncompressed_size, cumulative_compressed_size,
445
445
+
cumulative_uncompressed_size, cursor, prev_bundle_hash, compressed, created_at
444
446
FROM plc_bundles
445
447
WHERE EXISTS (
446
448
SELECT 1 FROM json_each(dids)
···
466
468
if afterTime.IsZero() {
467
469
query = `
468
470
SELECT bundle_number, start_time, end_time, dids, hash, compressed_hash,
469
469
-
compressed_size, uncompressed_size, cursor, prev_bundle_hash, compressed, created_at
471
471
+
compressed_size, uncompressed_size, cumulative_compressed_size,
472
472
+
cumulative_uncompressed_size, cursor, prev_bundle_hash, compressed, created_at
470
473
FROM plc_bundles
471
474
ORDER BY start_time ASC
472
475
LIMIT 1
···
475
478
} else {
476
479
query = `
477
480
SELECT bundle_number, start_time, end_time, dids, hash, compressed_hash,
478
478
-
compressed_size, uncompressed_size, cursor, prev_bundle_hash, compressed, created_at
481
481
+
compressed_size, uncompressed_size, cumulative_compressed_size,
482
482
+
cumulative_uncompressed_size, cursor, prev_bundle_hash, compressed, created_at
479
483
FROM plc_bundles
480
484
WHERE start_time >= ?
481
485
ORDER BY start_time ASC
···
498
502
&bundle.CompressedHash,
499
503
&bundle.CompressedSize,
500
504
&bundle.UncompressedSize,
505
505
+
&bundle.CumulativeCompressedSize,
506
506
+
&bundle.CumulativeUncompressedSize,
501
507
&cursor,
502
508
&prevHash,
503
509
&bundle.Compressed,