File tree Expand file tree Collapse file tree 2 files changed +3
-7
lines changed Expand file tree Collapse file tree 2 files changed +3
-7
lines changed Original file line number Diff line number Diff line change 1
1
BEGIN ISOLATION LEVEL REPEATABLE READ, READ ONLY;
2
2
{{ ~#each tables }}
3
3
{{ ~#if this.filter }}
4
- \copy (
5
- SELECT {{ this.columns }}
6
- FROM "{{ this.name }} "
7
- WHERE {{ this.filter }}
8
- ) TO 'data/{{ this.name }} .csv' WITH CSV HEADER
4
+ \copy (SELECT {{ this.columns }} FROM "{{ this.name }} " WHERE {{ this.filter }} ) TO 'data/{{ this.name }} .csv' WITH CSV HEADER
9
5
{{ ~else }}
10
6
\copy "{{ this.name }} " ({{ this.columns }} ) TO 'data/{{ this.name }} .csv' WITH CSV HEADER
11
7
{{ ~/if }}
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ struct TableConfig {
42
42
#[ derive( Debug , Serialize ) ]
43
43
struct HandlebarsTableContext < ' a > {
44
44
name : & ' a str ,
45
- filter : Option < & ' a str > ,
45
+ filter : Option < String > ,
46
46
columns : String ,
47
47
column_defaults : BTreeMap < & ' a str , & ' a str > ,
48
48
}
@@ -59,7 +59,7 @@ impl TableConfig {
59
59
if columns. is_empty ( ) {
60
60
None
61
61
} else {
62
- let filter = self . filter . as_ref ( ) . map ( String :: as_str ) ;
62
+ let filter = self . filter . as_ref ( ) . map ( |s| s . replace ( '\n' , " " ) ) ;
63
63
let column_defaults = self
64
64
. column_defaults
65
65
. iter ( )
You can’t perform that action at this time.
0 commit comments