* Sub: Add new formatter to export data to sql like mycli
Body: New formatter is added, we can export query result to sql
insertion like mycli
==== End ====
* Sub: Install black and reformat code
Body:
==== End ====
* Sub: Add unit tests for new formatter
Body:
==== End ====
* Sub: Add new formatter to pgclirc
These config properties got introduced in 41dd24e8 as a means to have
more granular control over the syntax highlighting. The problem is that
these cannot be in the default config file since `get_config()` always
reads both the default config file and the user specified one, and there
is no way to unset these variables in the user specified config file to
restore their default behavior. Even if there would be a way, it
wouldn't be intuitive at all to be required to unset some random
settings under the `[colors]` section just to be able to use the well
documented `syntax_style` setting.
Note that one *can* still set these three lines in their user config
file if they want to utilize them.
Resolves#1212
* adds ternary to decide whether bottom_toolbar is shown based on config value
* runs black format
* adds name to authors
* modifies changelog.rst
* removes change in changelog.rst
* formats config
* removes unused variable, adds change to changelog
* changes default back to true
* removed reference to var
* Added changes to remove the prompt on >1000 rows queries
* Reformatted with black
* Changed comment on row_limit parameter
* Added contribution to changelog and name to AUTHORS
* Refactored test to reflect new functionality
* Removed argument
* Removed debug echo statement
* Reformatted with black
* Added changes to remove the prompt on >1000 rows queries
* Reformatted with black
* Changed comment on row_limit parameter
* Added contribution to changelog and name to AUTHORS
* Refactored test to reflect new functionality
* Removed argument
* Removed debug echo statement
* Reformatted with black
* Added missing issue numbers in changelog
* Reformatted code using black
* Cherry-picked prompt-toolkit 2.0 changes.
* Increase help timeout.
* Missed one.
* Fixes editor command.
* Expect exact to fix named query error.
* Unicode is non-optional with ptk 2.0.
* Unicode literals all the things (almost).
* PEP8.
* Change how we swap completers.
* By default, bottom toolbar styles are reversed. We don't want that.
* Adapt styles to 2.0.
* The future is now. Switch to ptk 2.0 style names.
* PEP8.
* Flag for enable_open_in_editor.
* add class:prompt to prompt
* Removed workaround for #668. Some renaming.
* use pgcli.completer instead of app.current_buffer.completer
* enable_system_prompt=True like old prompt toolkit
* keep search_ignore_case enabled (was ignore_case)
* fix closing parenthese
* keep marking class:continuation token for continuation
* capture KeyboardInterrupt manually
AbortAction has been removed in Prompt_toolkit 2.0
* replace C-J with enter, add more comments
* reversed ([...]) to [(...)] (oops)
* pep8 fixes
* Does Vi mode have to be applied to session every time?
* (workaround) also enable vi_mode after edit command
* Fixed test errors after rebasing on master.
And schema-qualifying them, of course, so that for `SELECT * FROM bar`
we might suggest `buildings.barns` and for `select dopi` we might
suggest `maintenance.delete_old_personal_info()`, for example.
Controlled by a config setting, `search_path_filter`, in case anyone
prefers the old behaviour.
... i.e. suggesting foo.fooid instead of just fooid
Controlled using a config-file setting:
**qualify_columns**: always/never/**if_more_than_one_table**.
To enable the proper sorting of qualified column suggestions, we
introduce the concept of synonyms for suggestions
(in `pgcompleter.find_matches`). They way synonyms work is that a
number of synonyms may be provided for a suggestion sent to
`find_matches`. If synonyms are provided, sorting is based on how
well the best synonym matches the input, instead of only comparing
the input to the suggestion text.
In this case, the unqualified name acts as a synonym.
I have a couple of other ideas of use cases where we can use synonyms
to get better completions with less typing for the user, which I intend
to explore later.
If config.main.generate_aliases is True, for `SELECT * FROM `, we suggest `FooBar FB` and `foo_bar fb` instead of `FooBar` and `foo_bar`, respectively.
To be able to add a test, I had to add support for testing with different settings, which meant I could also add tests for casing.
There are two non-obvious changes that I can think of:
1. The lexical sorting of matches is modified so as to sort spaces and underscores before letters and to sort case-insensitively. This is so that e.g `Foob F` comes before 'FooBar FB' when `foob` is input.
2. We now suggest `some_func()` instead of `some_func` (because suggesting `some_func sf` didn't make any sense).