@@ -569,6 +569,43 @@ impl Table for RuntimePstatSeries {
569
569
}
570
570
}
571
571
572
+ struct ArtifactSize ;
573
+
574
+ #[ derive( Serialize ) ]
575
+ struct ArtifactSizeRow < ' a > {
576
+ aid : i32 ,
577
+ component : & ' a str ,
578
+ size : i32 ,
579
+ }
580
+
581
+ impl Table for ArtifactSize {
582
+ fn name ( ) -> & ' static str {
583
+ "artifact_size"
584
+ }
585
+
586
+ fn sqlite_attributes ( ) -> & ' static str {
587
+ "aid, component, size"
588
+ }
589
+
590
+ fn postgres_attributes ( ) -> & ' static str {
591
+ "aid, component, size"
592
+ }
593
+
594
+ fn postgres_generated_id_attribute ( ) -> Option < & ' static str > {
595
+ None
596
+ }
597
+
598
+ fn write_postgres_csv_row < W : Write > ( writer : & mut csv:: Writer < W > , row : & rusqlite:: Row ) {
599
+ writer
600
+ . serialize ( ArtifactSizeRow {
601
+ aid : row. get ( 0 ) . unwrap ( ) ,
602
+ component : row. get_ref ( 1 ) . unwrap ( ) . as_str ( ) . unwrap ( ) ,
603
+ size : row. get ( 2 ) . unwrap ( ) ,
604
+ } )
605
+ . unwrap ( ) ;
606
+ }
607
+ }
608
+
572
609
// `Nullable<T>` helps to work around the fact that the `csv` crate (and the CSV
573
610
// format in general) doesn't distinguish between nulls and empty strings, while
574
611
// the Postgres CSV format does.
@@ -699,6 +736,7 @@ async fn main() -> anyhow::Result<()> {
699
736
copy :: < RustcCompilation > ( & sqlite_tx, & postgres_tx) . await ;
700
737
copy :: < RuntimePstatSeries > ( & sqlite_tx, & postgres_tx) . await ;
701
738
copy :: < RuntimePstat > ( & sqlite_tx, & postgres_tx) . await ;
739
+ copy :: < ArtifactSize > ( & sqlite_tx, & postgres_tx) . await ;
702
740
enable_table_triggers ( & postgres_tx, & tables) . await ;
703
741
704
742
// This is overly paranoid, but don't commit the Postgres transaction until
0 commit comments