1
1
mirror of https://github.com/dbcli/pgcli.git synced 2024-10-06 10:17:15 +03:00
Commit Graph

435 Commits

Author SHA1 Message Date
Thomas Roten
f14d3b2e10 Do not expect numbers in exponent notation. 2017-06-23 14:46:07 -05:00
Thomas Roten
de9069d3d9 Merge branch 'master' of github.com:dbcli/pgcli into feature/cli_helpers_output_format
* 'master' of github.com:dbcli/pgcli:
  Use standard NullHandler
  Golf pep8radius
  Fix PEP8 empty line errors
2017-06-19 08:42:20 -05:00
Étienne BERSAC
e124c03575
Fix PEP8 empty line errors 2017-06-14 18:12:05 +02:00
Thomas Roten
6a330140bb Remove tabulate and expanded output. 2017-06-11 21:20:24 -05:00
Thomas Roten
61f0d63013 Initial work on using CLI Helpers. 2017-06-11 21:07:40 -05:00
Irina Truong
422ea6e649 Fixed copypaste that should not have been checked in. 2017-06-10 16:37:52 -07:00
Irina Truong
ea0556b8c6 Schema name should be escaped in SET SCHEMA. 2017-06-09 14:41:33 -07:00
Alexander Schmolck
0c729909cd Make it possible to use SSL with pgcli
This adds support for additional url query params which make stuff like

```
pgcli "postgres://user:pass@host.invalid/db?\
sslmode=verify-full&sslcert=my.pem&sslkey=my-key.pem&sslrootcert=ca.pem"
```

work. More generally it allows one to pass through various extra connection
options.
2017-05-25 14:49:30 +01:00
Dick Marinus
c6ae43a398 Merge remote-tracking branch 'upstream/master' into feature/tox_behave 2017-05-22 20:45:55 +02:00
Dick Marinus
bbb0866806 Add behave to tox 2017-05-22 20:44:02 +02:00
Dick Marinus
0031814627 fix pgspecial update in behave tests 2017-05-06 15:51:47 +02:00
Dick Marinus
f39dda5773 Behave remove boiler plate code 2017-05-02 20:20:13 +02:00
Irina Truong
e604096d96 Get rid of tmp var. 2017-04-29 15:23:13 -07:00
Irina Truong
84d89250cd Merge branch 'master' into feature/behave_fix_cleanup 2017-04-29 14:55:58 -07:00
Irina Truong
b2a22580a6 Merge pull request #706 from dbcli/feature/behave_tee
Test using behave the tee command
2017-04-29 14:51:48 -07:00
darikg
5508d725b9 Merge pull request #693 from bersace/well-known-following-keywords
Complete well known following keywords
2017-04-29 15:47:33 -04:00
Dick Marinus
5a60402649 Test using behave the tee command 2017-04-29 21:35:06 +02:00
Dick Marinus
d71032c37f behave fix clean up
In an earlier commit I've changed the current working directory and
the removal of a temporary file didn't take that into account.
2017-04-29 10:10:05 +02:00
Dick Marinus
fb25e4b923 remove debugging logfile 2017-04-29 10:02:15 +02:00
Dick Marinus
8fa3d18353 behave test source command 2017-04-28 21:16:11 +02:00
Dick Marinus
6f1f4bfa8e behave quit pgcli nicely 2017-04-28 18:00:51 +02:00
Étienne BERSAC
219b4a52d9
Fix PEP8 for #693 2017-04-27 21:32:44 +02:00
Étienne BERSAC
293b6b3a41
Complete keywords depending on previous token
Keywords list is based on
https://www.postgresql.org/docs/9.6/static/sql-commands.html.
2017-04-27 21:32:43 +02:00
Irina Truong
bad238f996 Merge pull request #686 from owst/column_completion_for_order_by_and_distinct
Suggest columns for `ORDER BY` and `DISTINCT` (fixes #685)
2017-04-26 11:01:32 -07:00
Owen Stephens
3d560baf6c Suggest columns for ORDER BY and DISTINCT (fixes #685)
Having typed an alias name in an `ORDER BY` or (`SELECT`) `DISTINCT`
clause, the alias was not taken account of, and the completion simply
listed all columns. This change fixes that, and makes the autocompletion
behave the same as in `SELECT` and `WHERE` clauses.
2017-04-26 01:10:57 +01:00
Dick Marinus
bc47a07d92 behave pager wrapper 2017-04-25 07:37:53 +02:00
Amjith Ramanujam
1e1d980ae2 Merge pull request #667 from dbcli/koljonen/tests_parametrize_completer
Parametrize completer in tests + deduplicate test code
2017-04-21 07:40:13 -07:00
Amjith Ramanujam
edf40d052b Merge branch 'master' into koljonen/case_column_titles 2017-04-21 07:38:14 -07:00
Irina Truong
578a36a6c0 Switched back to expect_exact in iocommands test. 2017-03-31 16:08:59 -07:00
Dick Marinus
586738f0b3 switch from nano to ex 2017-03-31 16:04:18 -07:00
Dick Marinus
aaf31e87be Fix coverage tests, fix PGPASSWORD
- I've copied my changes in .travis.yml from mycli
- Changed PGPASS to PGPASSWORD
2017-03-31 16:00:54 -07:00
Irina Truong
38558e165e After editor command, expect colored sql. 2017-03-31 16:00:54 -07:00
Irina Truong
19511b0fe9 Renamed pgcli to dbcli and postgres to dbserver, to make .feature files reusable. 2017-03-31 16:00:54 -07:00
Irina Truong
4aea9015aa Added coverage support for functional tests. 2017-03-31 16:00:54 -07:00
Irina Truong
5fdcb889bd Fixed failing test. 2017-03-31 16:00:54 -07:00
Irina Truong
8b1b486871 Housekeeping: separated test steps into different files. 2017-03-31 16:00:54 -07:00
Irina Truong
fcff05d4db Removed unnecessary 'pgcli installed' test step. 2017-03-31 16:00:54 -07:00
Joakim Koljonen
76b6098afd
Make pylint happier with metadata.py
A bunch of cosmetic changes to be more compliant with PEP80 and pylint.
And I added a pylintrc so that we can ignore some rules that just add
too much clutter.
2017-03-17 03:33:41 +01:00
Joakim Koljonen
9a8d2c2d6f
Make format_output take a settings object 2017-03-16 03:06:56 +01:00
Joakim Koljonen
6188c86201
Deduplicate tests: Add some helper functions to metadata.py 2017-03-15 02:58:02 +01:00
Joakim Koljonen
17ff3bb937
Deduplicate tests: Various simplifications
Remove unnecessary variables, unnecessary calls to set().
2017-03-15 02:57:32 +01:00
Joakim Koljonen
d67329279f
Deduplicate tests: add metadata.qual, metadata.no_qual
Put some commonly used settings for the completer parametrization
in metadata.py to avoid repeating them for a bunch of tests.
2017-03-15 02:57:18 +01:00
Joakim Koljonen
83a1661ed3
Deduplicate tests: Add Testdata.get_result() method
Basically put some code that was in every smart_completion test in
this method.
2017-03-15 02:56:58 +01:00
Joakim Koljonen
8c487c7d78
Deduplicate tests: Change len('...') to len(text)
This is to simplify the next commit.
2017-03-15 02:56:29 +01:00
Joakim Koljonen
3f51a6e596
Add empty lines between functions (PEP 80) 2017-03-15 02:55:40 +01:00
Joakim Koljonen
c0a1220444
Parametrize completer in tests
This introduces functionality for running the same test case for
different completer settings. This should improve code-path coverage.
I've set up all the old tests to run with all configs that should have
identical output.
2017-03-15 02:55:28 +01:00
darikg
7b14da9b4c Merge pull request #649 from dbcli/koljonen/suggest_from_all_schemas
Suggest objects from schemas not in search_path
2017-03-14 16:36:36 -04:00
Joakim Koljonen
cec8aaf16d
Make schema-qualified objects sort after non-schema-qualified 2017-03-13 22:58:31 +01:00
koljonen
1277752d62
Find statements inside function body
Consider this script
```
CREATE FUNCTION foo() returns text LANGUAGE SQL AS $func$
SELECT 1 FROM Bar;
SELECT <cursor> FROM Baz;
$func$;
```
The change here is that `SELECT <cursor> FROM Baz;` will be seen as the
current statement, instead of the whole function definition.
This means we'll no longer get column suggestions from `Bar`.
2017-03-09 01:41:11 +01:00
Amjith Ramanujam
7f009c630f Add support for unicode chars in expanded mode. 2017-03-06 19:20:34 -08:00
Joakim Koljonen
6b8c62d0ec
Add MATERIALIZED VIEW keywords 2017-03-06 23:16:29 +01:00
Joakim Koljonen
bdf2a0e26a
Start suggesting tables/functions/views/types not in search_path
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.
2017-03-05 02:21:31 +01:00
Darik Gamble
f314f8301b Suggest keywords after ALTER 2017-02-25 09:01:11 -05:00
Joakim Koljonen
ce55abc660
Initialism search for columns and functions
E.g. for table `Foo` with columns `FooBar` and `Fabulous`, inputting
`SELECT * FROM Foo F WHERE F.fb` will suggest `FooBar` as the #1 choice.
Likewise, given the functions `baz_baz()` and `baab()`, inputting
`SELECT bb` will have `baz_baz()` as the first option.
2016-12-12 02:45:39 +01:00
Joakim Koljonen
813afcaf11
Search table suggestions using initialisms
The idea is that if you have e.g. a table called `FooBar`, where we'd
use the initialism `FB` as an alias (suggesting `FooBar FB`),
inputting e.g. `SELECT * FROM FB` should suggest `FooBar FB` (or
`FooBar` if aliasing is disabled). Ditto for functions, views and joins.
The solution is that we send `FB` as a `synonym` to `find_matches`,
which results in the `FooBar` suggestion rising to the top (above e.g.
`FabulousTable`).
2016-12-12 02:45:39 +01:00
koljonen
45326335e6
Support for table-qualifying column suggestions
... 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.
2016-12-05 03:15:53 +01:00
Joakim Koljonen
c2e76e335e
Fix scoping for columns from CTEs
We were suggesting all CTE columns regardless of whether the CTE in
question was included in the FROM clause.
2016-11-20 23:01:41 +01:00
Joakim Koljonen
279d6e85a7
Fix crash after with 2016-11-20 21:18:40 +01:00
Lele Gaifax
d923ab3efd Fix issue #603
Python 3 forbids comparisons between different types: use a tuple
containing a single 0 (zero) as the priority for path matches so that it
can be compared with those generated by the workhorse method find_matches().
2016-10-31 18:33:07 +01:00
Darik Gamble
0881902207 If prev_keyword is an unrecognized keyword, go backward until we find a recognized one 2016-10-17 13:48:55 -04:00
Foxygrandpa
0ef94c984b master: decimal and float format in config file 2016-09-27 13:43:28 +03:00
Foxygrandpa
fa4ebb5660 master: numbers division for int and float 2016-09-15 20:55:42 +03:00
Joakim Koljonen
514b594909
Fix crash bug with leading parenthesis 2016-09-12 23:48:22 +02:00
Darik Gamble
f506dfbcaa Support configuring keyword casing preferences 2016-09-04 08:41:15 -04:00
Amjith Ramanujam
db496fb354 Merge pull request #568 from dbcli/koljonen/hack_for_sqlparse_crashes
Temporary hack for sqlparse crashing after AS
2016-08-23 17:23:46 -07:00
Joakim Koljonen
8d2265a65d
Temporary hack for sqlparse crashing after AS
And a regression test.
2016-08-23 20:14:00 +02:00
Joakim Koljonen
6d41a8a6bd
Fix crash bug with named queries
And add behave tests.
2016-08-23 13:47:04 +02:00
Amjith Ramanujam
ab6e54b2cf Merge pull request #553 from dbcli/darikg/cte-suggestions
CTE-aware suggestions
2016-08-08 22:10:29 -07:00
Amjith Ramanujam
fb23a1e4ec Merge pull request #554 from dbcli/koljonen/suggestion_sorting
Some changes to sorting of suggestions
2016-07-29 07:33:37 -07:00
Darik Gamble
2407de0e4c Make suggestions based on local tables 2016-07-27 15:33:59 -04:00
Darik Gamble
8b8f257100 Rename the suggestion field tables to table_refs so we can add more table-specific properties without getting confused 2016-07-27 15:33:58 -04:00
Darik Gamble
c66fbbf598 Add parseutils module for processing CTEs (not hooked up yet) 2016-07-27 15:33:58 -04:00
Darik Gamble
a52ee78fcb Move parseutils tests into test subfolder 2016-07-27 15:33:58 -04:00
Darik Gamble
4d84c55df3 packages/function_metadata.py --> packages/parseutils/meta.py 2016-07-27 14:27:24 -04:00
Amjith Ramanujam
70323ea1c7 Fix failing tests. 2016-07-26 23:17:09 -07:00
Joakim Koljonen
f94bd6882d
Some changes to sorting of suggestions 2016-07-08 16:51:55 +02:00
koljonen
f09bb42d67
Better scoping for tables in insert statements
This commit makes it so that given `INSERT INTO foo(<cursor1>) SELECT <cursor2> FROM bar;`, we suggest `bar` columns for `<cursor2>` and `foo` columns for `<cursor1>`. Previous behaviour is sugggesting columns from both tables in both cases.
2016-07-06 20:03:24 +02:00
darikg
1605bf1cdb Merge pull request #531 from dbcli/koljonen/generate_aliases
Suggest table aliases + add tests for casing
2016-07-06 07:39:56 -04:00
Eric Wald
ae0fcab9c9 Repair exception thrown on urls with ports
When the database URL contains a port, uri.port is (at least in Python 2.7.6) an integer, not a string, so urlparse.unquote chokes on it.
Fixes issue #536, but is probably worth verifying on Python 3.
2016-06-29 16:59:42 -06:00
koljonen
e15b3ec0a1
Suggest table aliases + add tests for casing
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).
2016-06-27 21:26:59 +02:00
koljonen
17f44545d8
In test_sqlcompletion, remove some code duplication 2016-06-27 21:15:29 +02:00
koljonen
ed4fcaf683
Smart completion tests: make every test have its own completer 2016-06-20 13:30:16 +02:00
koljonen
475796ab4f
Fix indentation of test_smart_completion_* metadata dicts 2016-06-18 21:25:59 +02:00
koljonen
69a6d0b38f
In completion tests, get columns from metadata instead of manually listing them 2016-06-18 21:25:55 +02:00
koljonen
932603130d
In completion tests, get functions from metadata instead of manually listing them 2016-06-18 21:24:02 +02:00
koljonen
a79e124025
In completion tests, get views from metadata instead of manually listing them 2016-06-18 21:24:00 +02:00
koljonen
d40bae021e
In completion tests, get tables from metadata instead of manually listing them 2016-06-18 21:23:12 +02:00
koljonen
42cf384ede
In completion tests, get datatypes from metadata instead of manually listing them 2016-06-18 21:21:17 +02:00
koljonen
c3c18bcebe
In completion tests, get schemas from metadata instead of manually listing them 2016-06-18 21:18:32 +02:00
koljonen
a784c7a158
Consolidate common code in smart_completion tests 2016-06-18 21:16:12 +02:00
koljonen
5b20e107b8
Fix some join-condition issues
When self-joining a table with an FK to or from some other table, we got a false FK-join suggestion for that column.
There was also a problem with quoted tables not being quoted in the join condition.
And there were a couple of problems when trying to join a non-existent table or using a non-existent qualifier (`SELECT * FROM Foo JOIN Bar ON Meow.`).

I also rewrote get_join_condition_matches a bit in the process, hopefully making it a bit simpler.
2016-06-16 19:27:57 +02:00
koljonen
b69404c215
Add a couple of tests suggested by @darikg 2016-06-14 22:44:36 +02:00
koljonen
6cb8c38628
Join conditions: alias tables already included in query
If we have the input `SELECT * FROM Foo JOIN `, we now suggest `Foo Foo2 ON Foo2.ParentID = Foo.ID` (given the appropriate casing file and FK).
There were also some problems with quoted tables and with the casing of table aliases, which are now fixed.
I also made a few cosmetic changes to get_join_matches (pgcompleter.py) just to make it a bit easier to work with.
2016-06-14 22:34:10 +02:00
koljonen
351a58554b
Also exclude NATURAL JOIN from join suggestions 2016-06-10 03:51:52 +02:00
koljonen
582852adb6
Various changes after review 2016-06-10 03:26:42 +02:00
koljonen
9b6a72e9e0
For 'JOIN <cursor>', suggest 'foo on foo.fooid = bar.fooid'
This is based on my previous work on suggesting join conditions, but here instead we suggest the whole join. What we do is simply check all the tables in the statement for FK relationships and then suggest joins based on those. I think this will not only save key presses, but also be rather useful when exploring an unfamiliar (part of a) database.

There's one non-obvious change in this commit (that I can think of): When calling **sqlcompletion.text_before_cursor**, the **text_before_cursor** argument now no longer includes **word_before_cursor**. This is because for 'SELECT * FROM foo JOIN bar<cursor>', we would otherwise consider the table **bar** already included in the statement and thus suggest e.g. 'baz on baz.barid = bar.barid'.
2016-06-09 00:55:07 +02:00
Darik Gamble
e5cc38d835 column keyword suggests columns 2016-06-07 14:44:52 -04:00
darikg
92cc469b7b Merge pull request #512 from koljonen/casing
Custom casing of table/column/function/view names
2016-06-06 17:21:32 -04:00
Amjith Ramanujam
163b2e2087 Merge pull request #521 from Smotko/configure-row-limit
Make too many rows warning limit configurable
2016-06-05 14:50:39 -07:00
koljonen
7e45e893ca
Custom casing of table/column/function/view names
This adds support for defining the casing to be used in completions (for unquoted names). The casing is determined by the casing file, which consists of a \n-separated list of names using the preferred casing. This file can either be populated manually or created automatically (based on usage in SQL/PLPGSQL functions), with a config setting.
2016-06-04 23:05:32 +02:00
darikg
52bac9af85 Merge pull request #513 from koljonen/order_columns_by_db_column_order
Order columns by in-table order when expanding *
2016-06-04 07:34:35 -04:00
Anže Pečar
302d425609 Make sure low_count is never greater than over_default 2016-06-02 18:37:23 -07:00
Anže Pečar
1947e74c00 Add test for row_limit parameter 2016-06-02 18:37:23 -07:00
koljonen
5d9dfcdcc3
Use pg_proc.proargmodes &c. instead of parsing arg_list
Getting the parameters from proargnames, proallargtypes and proargmodes instead of from parsing the arg_list string simplifies FunctionMetadata quite a bit.
I also made the ColumnMetadata for table/view columns use the same format for the type (i.e. regtype instead of typname). This means we now get join-condition suggestions for joining tables/views to functions, which didn't work before.
2016-06-02 01:44:31 +02:00
darikg
f912633d6d Merge pull request #516 from dbcli/koljonen/fix_another_casing_issue
Fix issue with 'SELECT Foo.*<cursor> FROM Foo'
2016-06-01 16:30:06 -04:00
koljonen
e217bac439
Fix issue with 'SELECT Foo.*<cursor> FROM Foo'
In the expansion, we got '"Foo".<col>' when we should have gotten 'Foo.<col>'.
2016-05-31 23:45:11 +02:00
koljonen
740085dd23
Order columns by in-table order when expanding *
And add a setting to use alphabetic order instead.
We simply get the columns from the database in the canonical order, and then sort them if the user has opted for alphabetic order.
2016-05-31 01:29:44 +02:00
koljonen
843b859c1d
Fix two casing issues with schemas
1. In 'SELECT * FROM Foo.', Foo was not recognized as foo.
2. In 'SELECT * FROM "Foo"', objects in Foo were not suggested.
2016-05-27 11:29:23 +02:00
darikg
a9c209df7a Merge pull request #510 from koljonen/fixtablecasingissue2
Fix another problem where table names would not be recognized when nott in lower case
2016-05-25 19:11:07 -04:00
koljonen
59e3068a07
Fix another problem where table names would not be recognized when not in lower case
My previous fix didn't cover the case 'INSERT INTO Foo(<cursor>)', which is now covered.
2016-05-25 18:31:34 +02:00
koljonen
7f8bd9bbd4
Make join-condition suggestions work with multi-line queries 2016-05-24 16:11:36 +02:00
koljonen
8431b32166
Support for join-condition suggestions after ON
The user types 'SELECT * FROM parenttable p JOIN childtable c on '. We then suggest ['c.parenttableid = p.parenttableid', 'c.createdby = p.createdby', ...] as completions.
The suggestions are FK matches first, then name matches for int columns, then name matches for other columns, sorted by proximity from the cursor to the other table.

Some changes:
    For "JOIN Foo USING(<cursor>)", now only columns present in Foo are suggested.
    For all suggestions after 'ON', now only the tables before the cursor are considered.
    meta[reltype]][relname] goes from being a list of columns to being an OrderedDict {column_name:ColumnMetadata}, where the ColumnMetaData contains the column's name, data type and a list of FKs involving the column. This entails modification of a number of functions dealing with columns.
2016-05-24 14:18:19 +02:00
koljonen
a5fa8ca1cb
Fix problem where table names would not be recognized when not in lower case 2016-05-20 00:00:31 +02:00
darikg
30de80223b Merge pull request #505 from koljonen/drop_asterisk_column_suggestion
Stop suggesting * as a column
2016-05-17 19:40:42 -04:00
Stuart Quin
d378ddf559 Merge pull request #504 from dbcli/amjith/unicode-notices
Support unicode strings in notices.
2016-05-17 20:32:10 +01:00
Amjith Ramanujam
0524e0adbf Disable the test for unicode notices. 2016-05-17 12:04:30 -07:00
koljonen
a60ee9a85f
Stop suggesting * as a column
I don't think suggesting * is of use to anyone, and it's in the way for anyone who just wants a column.
2016-05-17 12:27:33 +02:00
darikg
8d426c2db6 Merge pull request #502 from koljonen/cleanup
Remove dead code and fix a broken test
2016-05-16 18:44:25 -04:00
darikg
087fb1cb7d Merge pull request #492 from koljonen/master
Completion to column list when *  is entered
2016-05-16 18:36:46 -04:00
koljonen
0af862f1ff
Remove obsolete comments 2016-05-16 17:31:52 +02:00
koljonen
8e24cd41dc
Various small changes after code review 2016-05-16 13:48:46 +02:00
Amjith Ramanujam
69ee125bf1 Trying the command in a single line. 2016-05-15 22:59:53 -07:00
Amjith Ramanujam
2cfd9fc913 Add a test for unicode tests. 2016-05-15 22:39:41 -07:00
darikg
5844690138 Merge pull request #501 from koljonen/fixusing
Fix bug where "USING(<cursor>" wasn't detected properly + add test case
2016-05-15 14:44:15 -04:00
koljonen
ef99084954
Remove new test I added and edit the existing ones to cover the same case instead
As suggested by darikg
2016-05-15 20:29:48 +02:00
koljonen
838d4f6950
Remove dead code and fix a broken test (all found by Codacy) 2016-05-15 19:41:30 +02:00
darikg
30727196ed Merge pull request #497 from koljonen/allownonsetreturningfunctionsinfromclause
Improve filtering of functions for FROM clause
2016-05-15 13:01:10 -04:00
koljonen
fffa740fbc
Fix more test bugs ... apparently the able order can be indeterministic 2016-05-15 18:35:22 +02:00
koljonen
17a2b3a4b7
Fix some bugs in the tests I added 2016-05-15 18:05:48 +02:00
koljonen
926004eedd
Fix bug where "USING(<cursor>" wasn't detected properly + add test case 2016-05-14 19:08:53 +02:00
koljonen
de83a72abf
After code review: Remove "parent" field I added to Columns
It turned out there was a way to accomplish qualification of column names without it.
2016-05-14 18:40:32 +02:00
koljonen
b793ed5c00
Some changes after code review
Move *-expansion logic from find_matches to get_column_matches
Make the expansion always qualify column names if there's more than one table. For this I changed populate_scoped_columns to return a dict{TableReference:[column names]}; I took this code from my other branch joinconditions.
Add a bunch of tests
2016-05-14 18:19:55 +02:00
koljonen
6d920340b8
Fix tests I broke in eaf3a11c94 2016-05-14 15:04:55 +02:00
koljonen
16efe77433
Support for qualifiers in * expansion
This means that when the user expands the * in "select t.* from tbl t", the result is "select t.col1, t.col2, t.col3, ... from tbl t".
2016-05-09 14:35:14 +02:00
koljonen
eaf3a11c94
Improve filtering of functions for FROM clause
Change from filtering out all non-set-returning functions to only filteirng out windowing functions and aggregate functions.
Non-set-returning functions are legal in the FROM clause and can be quite useful.
2016-05-07 13:48:11 +02:00
Pavel Savchenko
1dabd3be63 Unquote URI parts prior to using in connection
As you know [RFC-3986][1] allows passing "disallowed" characters
as long as these are percent encoded.
Since we deal with the url parsing, we can expect this to happen
and need to use the values after they have been decoded.

[1]: https://tools.ietf.org/html/rfc3986#section-2.1
2016-04-27 17:58:16 +02:00
Anthony Lai
f1ff7158e0 Fix auto-completion breaking for table names with caps 2016-03-22 23:04:33 -07:00
Anthony Lai
eb3ef2e143 unescape completion names for lexical priority 2016-03-22 22:08:21 -07:00
Anthony Lai
1fe6ff06a2 Fix lexical order tiebreaking 2016-03-18 21:27:07 -07:00
Fernando Mora
6af6454e59 More appropiate dates/times types test name 2016-02-26 16:27:12 +01:00
Fernando Mora
5f4bded599 Issue #448. Add timestamptz to DATE custom extension 2016-02-26 16:21:27 +01:00
Daniel Rocco
66f9647210 Use lexical order to break ties when fuzzy matching 2016-02-14 23:33:23 -05:00
Amjith Ramanujam
fea50b59db Merge pull request #457 from dbcli/stuartquin/cast-bc-dates
Issue #448 extension for BC dates
2016-02-03 19:23:22 -08:00
David Szotten
d4ffbe6104 oh py2.6 how i don't miss you 2016-02-03 22:31:10 +00:00
David Szotten
85181ab252 factor out ensure_dir_exists and use for log 2016-02-03 22:28:04 +00:00
David Szotten
43a13ba065 a few more tests 2016-02-03 20:58:32 +00:00
David Szotten
bea392d7ed ensure target dir exists when copying config 2016-02-03 20:45:36 +00:00
Stuart Quin
37c10e45c8 Issue #448 extension for BC dates 2016-02-03 10:57:36 +00:00
David Szotten
f6c159e805 test for recent patch for execute_from_file
to prevent obvious regressions at least
2016-02-02 18:56:20 +00:00
Amjith Ramanujam
c4557a8215 Add a test case for enum unicode case. 2016-01-12 04:55:42 -08:00