tblfmt
tblfmt copied to clipboard
Add extraNewline option to TableEncoder
Adds extraNewline option. When set, the printed table will be followed by an empty line. Necessary for usqls PR362 to avoid printing the newline from usql code.
The option is set to true by default. This is a change to the default behavior. It will additionally fix the output of various \d commands. Previously the output was:
pg:postgres@localhost/postgres=> \dt
List of relations
Schema | Name | Type
--------+------------+-------
public | test_table | table
(1 row)
pg:postgres@localhost/postgres=>
Now it is:
pg:postgres@localhost/postgres=> \dt
List of relations
Schema | Name | Type
--------+------------+-------
public | test_table | table
(1 row)
pg:postgres@localhost/postgres=>
Previously:
pg:postgres@localhost/postgres=> \d *
Sequence "public.sequence1"
Type | Start | Min | Max | Increment | Cycles?
--------+-------+-----+---------------------+-----------+---------
bigint | 1 | 1 | 9223372036854775807 | 1 | "NO"
Sequence "public.sequence2"
Type | Start | Min | Max | Increment | Cycles?
--------+-------+-----+---------------------+-----------+---------
bigint | 1 | 1 | 9223372036854775807 | 1 | "NO"
pg:postgres@localhost/postgres=>
Now:
pg:postgres@localhost/postgres=> \d *
Sequence "public.sequence1"
Type | Start | Min | Max | Increment | Cycles?
--------+-------+-----+---------------------+-----------+---------
bigint | 1 | 1 | 9223372036854775807 | 1 | "NO"
Sequence "public.sequence2"
Type | Start | Min | Max | Increment | Cycles?
--------+-------+-----+---------------------+-----------+---------
bigint | 1 | 1 | 9223372036854775807 | 1 | "NO"
pg:postgres@localhost/postgres=>
In turn this newline is removed in PR362 to make sure the query results are still printed correctly.
The changes to the testdata/*.gz files are the same as in the example above.
@kenshaw PTAL