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

452 Commits

Author SHA1 Message Date
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
David Szotten
2b867820d9 don't error when completing parameter-less functions 2016-01-05 16:32:31 +00:00
Darik Gamble
90651ca7fe Really sort keywords after everything else 2015-11-26 14:17:47 -05:00
Darik Gamble
0f70ccad31 Add a bunch of tests for multiple joins 2015-11-25 16:17:08 -05:00
Amjith Ramanujam
5dde125d93 Merge pull request #421 from dbcli/darikg/support-leading-double-quote
Handle manually entered double-quote gracefully
2015-11-24 11:17:31 -08:00
Darik Gamble
2c4f4e689d Add more tests for qualified table names with or without quotes 2015-11-23 16:48:27 -05:00
Darik Gamble
75a184571a Rename old test to avoid redefinition
'test_simple_select_with_cols_multiple_tables' was defined twice with different bodies
2015-11-23 14:39:31 -05:00
Amjith Ramanujam
b68c2ab38c Add tests for the format_output. 2015-11-22 05:46:06 -08:00
Darik Gamble
9295cb9686 Fix suggestions after a manually entered double quote escape 2015-11-21 16:39:30 -05:00
Darik Gamble
692afc8240 Replace suggestion dicts with namedtuples 2015-11-16 07:41:27 -05:00
Darik Gamble
5b5e861258 extract_tables returns tuples, not lists 2015-11-16 07:28:22 -05:00
Darik Gamble
0cf0b7ff59 Update pgcompleter tests 2015-11-08 15:55:50 -05:00
Darik Gamble
886b048af0 PGCompleter initializes a prevalence counter (not used yet) 2015-11-08 15:55:49 -05:00
Darik Gamble
9c97d35606 New package prioritization and class PrevalenceCounter 2015-11-08 15:54:15 -05:00
Darik Gamble
1ea9bf735b Refactor a lot of run_cli into smaller submethods:
`_build_cli`, '_evaluate_command` and `_handle_server_closed_connection`

_evalute_command returns (output, MetaQuery) tuple where MetaQuery is a namedtuple
(query, successful, total_time, meta_changed, db_changed, path_changed, mutated)
2015-10-28 10:58:29 -04:00
Darik Gamble
edcc5c8a2d pgexecute.run returns two extra tuple elements: query, and success 2015-10-28 10:58:28 -04:00
Darik Gamble
6df33e959d exception_formatter returns only status, not the entire results tuple 2015-10-28 10:58:27 -04:00
Darik Gamble
488ac21dae trivial indent fix 2015-10-28 10:58:25 -04:00
Darik Gamble
c9b55ba12e Fix pgexecute tests 2015-10-28 10:58:25 -04:00
Iryna Cherniavska
2be25f5358 Setproctitle should be optional in tests. 2015-10-26 15:00:42 -07:00
Jacek Wielemborek
74c67a6dc6 Add a test written by darikg. Not actually executed, please confirm it. 2015-10-25 20:01:54 +01:00
Amjith Ramanujam
cc7b9d2d56 Make setproctitle optional in Windows 2015-10-23 02:49:20 -07:00
Stuart Quin
eea0cbd495 Clearer function name, handle passwords with spaces 2015-10-19 18:40:50 +01:00
Stuart Quin
748fcb7677 Issue #355 Use setproctitle to hide command line passwords 2015-10-18 21:56:52 +01:00
Darik Gamble
947cdb9506 support different error-handling options 2015-10-10 15:05:30 -04:00
Iryna Cherniavska
08347934c4 Fix for behave tests failing with pexpect 4.0. 2015-10-05 14:11:31 -07:00
darikg
4055b726cc Merge pull request #368 from dbcli/darikg/suggest-columns-from-functions
Suggest columns from functions
2015-10-04 09:31:11 -04:00
Amjith Ramanujam
12207f39fe Merge pull request #373 from dbcli/darikg/fix-need_completion_refresh
Fix need_completion_refresh
2015-10-03 14:48:16 -07:00
Darik Gamble
bb12d553a4 Fix need_completion_refresh
Was only actually checking the first command in multiple commands
2015-10-03 14:41:50 -04:00
Darik Gamble
9a7cae6cf5 Expand more join tests to check compound statements 2015-10-03 14:10:51 -04:00
Darik Gamble
ee0995ceed Fix suggestions in compound join clauses
Previously, this worked correctly, suggesting columns etc. from `a`
`SELECT * FROM abc a JOIN def d ON a.`

But this suggested only keywords:
`SELECT * FROM abc a JOIN def d ON a.id = d.id AND a.`
2015-10-03 14:04:00 -04:00
Darik Gamble
38f5e875ef Add missing test assertion 2015-10-03 10:01:06 -04:00
Darik Gamble
fc25e576eb Delete outdated comment 2015-10-03 09:59:13 -04:00
Darik Gamble
62b2962b63 Suggest fields from functions used as tables 2015-09-29 09:07:20 -04:00
Darik Gamble
07030e20d2 Move FunctionMetadata definition into its own package 2015-09-29 09:07:20 -04:00
Darik Gamble
a0266de192 Extract functions in the FROM clause as tables 2015-09-29 08:54:49 -04:00
Iryna Cherniavska
2020e7204d Using pgspecial as a separate module. Warning: this branch will not build. 2015-09-26 17:51:51 -07:00
Darik Gamble
169eb3ff58 Suggest set-returning functions as tables 2015-09-23 14:09:38 -04:00
Darik Gamble
2e9dce513b pgexecute returns additional function metadata 2015-09-23 14:09:37 -04:00
Darik Gamble
431ba8f695 Don't hide functions from pg_catalog 2015-09-22 13:00:35 -04:00
Iryna Cherniavska
72ea4edcec Strip color codes out of behave actual output. 2015-09-13 11:21:13 -07:00
Iryna Cherniavska
870b613f6f When behave fails, it prints out expected and actual output. 2015-09-13 10:19:25 -07:00
Iryna Cherniavska
6664337a85 Functional test for refresh command. 2015-09-06 10:18:21 -07:00
Iryna Cherniavska
62af9d3a96 Added refresher tests. 2015-09-05 18:31:53 -07:00
Amjith Ramanujam
6e1bc6fcd1 Merge pull request #342 from dbcli/j-bennet/completion-in-named-query
Autocompletion in named queries.
2015-08-25 21:45:53 -07:00
Amjith Ramanujam
d222e085b7 Update the tests for named query. 2015-08-25 19:41:04 -07:00
Iryna Cherniavska
037e8c84a0 Minor test changes. 2015-08-25 19:35:40 -07:00
Iryna Cherniavska
31b867f632 Autocompletion in named queries. Connect #270. 2015-08-25 19:35:40 -07:00
Amjith Ramanujam
e4c18532c3 Merge pull request #344 from dbcli/j-bennet/fix-read-from-file
Added read_from_file back into iospecial.
2015-08-25 19:26:16 -07:00
Amjith Ramanujam
fb86930cd6 Add tests for where clause with keywords. 2015-08-24 19:31:25 -07:00
Iryna Cherniavska
da12a70cbb Added read_from_file back into iospecial (it was removed but is still being used. Added integration test for editing a file. 2015-08-24 17:46:40 -07:00
Amjith Ramanujam
585b37e70f Fix failing tests for python 3. 2015-08-23 01:50:09 -07:00
Amjith Ramanujam
65398f0051 Fix failing tests. 2015-08-23 01:43:54 -07:00
Amjith Ramanujam
72b8e60d18 Merge pull request #337 from dbcli/darikg/multiline_open_quotes
Don't end multi-line query within a quote
2015-08-19 21:54:11 -07:00
Darik Gamble
9be09b8bf4 Add function to check for unclosed quotations 2015-08-18 06:04:08 -04:00
Amjith Ramanujam
f2e436ad2f Fix unicode issues and update tests. 2015-08-18 00:38:56 -07:00
Amjith Ramanujam
5796fa2b4e Fix tests for multiple queries with syntax error. 2015-08-18 00:27:40 -07:00
Iryna Cherniavska
9a35e5ef05 Started adding "service" option. Connect #289.
Switched to dsn-based approach (no config parsing).
2015-08-13 23:40:11 -07:00
Amjith Ramanujam
ad9c99f790 Merge pull request #323 from dbcli/darikg/bugfix-283
Fix #283
2015-08-05 15:43:05 -07:00
Amjith Ramanujam
4b644bf2f1 Merge pull request #324 from dbcli/darikg/bugfix-322
Fix #322
2015-08-05 15:04:33 -07:00
Amjith Ramanujam
259f4897a2 Merge pull request #320 from dbcli/darikg/bugfix-317
Add regression test for #317
2015-08-05 15:01:14 -07:00
Amjith Ramanujam
9ab49a2145 Merge pull request #321 from dbcli/j-bennet/integration-tests
Fixes for test database being in use problem.
2015-08-05 14:55:51 -07:00
Darik Gamble
3205fb0f85 Test completions with an escaped table alias 2015-08-05 15:47:27 -04:00
Darik Gamble
3ef99aa043 Test suggest_type with escaped table aliases 2015-08-05 15:46:13 -04:00
Darik Gamble
21125e8820 Test extract_tables with escaped table aliases 2015-08-05 15:45:40 -04:00
Darik Gamble
6a2771a9a2 Add tests for \c and \connect to suggest databases 2015-08-05 14:32:35 -04:00
Iryna Cherniavska
a895703201 Shortened expect timeouts. 2015-08-05 09:00:55 -07:00
Iryna Cherniavska
10d76fb978 Fixes for test database being in use problem. 2015-08-05 08:50:54 -07:00
Darik Gamble
e97cc6586d Add regression test for #317 2015-08-05 09:40:31 -04:00
darikg
a25dc906af Merge pull request #311 from dbcli/amjith/autocompletion-crash
Fix the crashing autocompletion on joins.
2015-08-02 10:34:49 -04:00
Amjith Ramanujam
09ccb535ec Add a test for the crashing bug fix. 2015-08-01 08:29:33 -07:00
Amjith Ramanujam
5de07bdbde Fix the crashing autocompletion on joins. 2015-08-01 08:22:31 -07:00
Amjith Ramanujam
1f147f5e7a Merge pull request #300 from dbcli/j-bennet/integration-tests
More integration tests
2015-08-01 07:45:22 -07:00
Iryna Cherniavska
2c9056133a More fiddling with python version string. 2015-07-31 09:49:38 -07:00
Iryna Cherniavska
59af55c90b Added python version suffix to test db name, so each version creates its own test db. 2015-07-31 09:43:58 -07:00
Iryna Cherniavska
ae2e56f319 Disconnect from test db after table drop. 2015-07-31 09:18:38 -07:00
Amjith Ramanujam
390839b945 Merge pull request #277 from darikg/darikg/completions-meta-display
[wip/rfc] Put meta info in the completions menu
2015-07-28 13:19:52 -07:00
Iryna Cherniavska
22670a8393 CRUD tests for database and table, select and update on table. 2015-07-28 10:21:43 -07:00
Iryna Cherniavska
4903604704 Working on more test steps. 2015-07-27 22:21:12 -07:00
Iryna Cherniavska
4a5c77d5ca Added tests for db create/drop, connect/disconnect. Fix for connecting with no password (trust). 2015-07-27 16:28:15 -07:00
Darik Gamble
7b997e4083 Update tests so they pass with metadisplay 2015-07-19 14:36:23 -04:00
Iryna Cherniavska
4980b4ef09 Moved behavioral tests into tests. Updated expected help output. Drop test db if exists. 2015-07-12 14:41:36 -07:00
Iryna Cherniavska
cb9905a44e Merge pull request #262 from dbcli/amjith/expanded_output_separator_fix
Make the horizontal separator in expanded mode a constant length.
2015-07-01 21:52:04 -07:00
Darik Gamble
581061440b pg_execute.run accepts a PGSpecial object, instead of calling special.execute directly 2015-06-30 12:40:53 -04:00
Darik Gamble
1355665270 format_output takes an extra arg instead of referencing pgspecial directly
This also allows us to simplify some of the tests in test_pgexecute,
which tested with and without expanded output by first running '\x',
which is a pretty roundabout way of mutating a global variable
2015-06-30 11:28:06 -04:00
Amjith Ramanujam
7c6c56de6b Fix the failing tests for expanded output. 2015-06-21 00:03:43 -07:00
Daniel Rocco
40149ad648 Add tests for fuzzy ranking adjustments. 2015-06-16 08:35:42 -04:00
Darik Gamble
4e46c01d3c Gross test that \dt, \df etc. run without error 2015-05-23 08:33:42 -04:00
Darik Gamble
9e621ba97c Support \dT to list datatypes 2015-05-23 08:33:42 -04:00
Darik Gamble
128264057e Suggest custom types in addition to built-ins 2015-05-23 08:33:41 -04:00
Darik Gamble
5692782bd2 Give pgexecute a datatypes() method to get custom type names
Not used yet
2015-05-23 08:33:39 -04:00
Darik Gamble
a169f01609 Suggest datatypes from a hardcoded whitelist 2015-05-23 08:33:39 -04:00
Darik Gamble
bd3d0fb924 Add test to find_prev_keyword for parentheses 2015-05-23 08:32:13 -04:00
Darik Gamble
70732f0025 drop schema and create schema should suggest schemas 2015-05-20 17:59:32 -04:00
Amjith Ramanujam
f906183b7e Fix a typo in the test fixture setup. 2015-05-14 08:40:27 -07:00
Amjith Ramanujam
0c9c51b4f7 Fix failing tests in Python 2. 2015-05-11 13:34:47 -07:00
Darik Gamble
e060dd398e improve suggestions in non-trivial WHERE clauses
sqlparse groups tokens belonging to the where clause into a single Where token (a subclass of TokenList). In order to handle cases beyond the simplest `SELECT * FROM foo WHERE`, we need to look "inside" of this token list.
2015-05-02 17:33:25 -04:00
Darik Gamble
ff9caf45f4 improve find_prev_keywords
1) Add clarifying comments
2) Fix bug where a keyword inside of a TokenList would result in a ValueError
3) Ignore as keywords a fixed list of logical operators
2015-05-02 17:33:23 -04:00
Iryna Cherniavska
dc3f094b1b Implemented external editor call. 2015-04-20 09:11:36 -07:00
Daniel Rocco
7fe802a33f Add suggest tests for INSERT INTO, COPY, UPDATE, DESCRIBE, JOIN, and TRUNCATE 2015-04-18 17:34:59 -04:00
Amjith Ramanujam
f4c5e5ae30 Add an extra test for the JOIN USING for good measure. 2015-04-17 09:39:02 -07:00
Amjith Ramanujam
049c51b971 Merge pull request #190 from darikg/joins
some join-related improvements
2015-04-16 22:30:38 -07:00
Amjith Ramanujam
7d4e57090c Merge pull request #202 from drocco007/feature/match-anywhere
Completion search text matches user-defined entities anywhere in the name
2015-04-15 06:29:43 -07:00
Amjith Ramanujam
dc94ca3820 Merge pull request #195 from darikg/pg_catalog
Improve handling of pg_catalog in metadata
2015-04-14 17:07:28 -07:00
Daniel Rocco
76b44443d1 Completion search text matches user-defined entities anywhere in the name
When searching for completions in smart completion mode, a potential
suggestion of a user-specified name (e.g. tables, functions, etc.) is
considered a match if the search text appears anywhere in the
suggestion. Keywords, special commands, and built-in functions still
use startswith matching.

Closes #193
2015-04-12 21:21:51 -04:00
Daniel Rocco
e85116d846 Handle a ',' entered before any completions gracefully
Fixes #197
2015-04-11 09:55:34 -04:00
Darik Gamble
41007c549e bugfix: don't exclude any schemata from metadata queries 2015-04-09 13:00:57 -04:00
Darik Gamble
90974ecff8 support 'JOIN ... USING (' by suggesting columns present in more than one table 2015-04-07 15:43:29 -04:00
Darik Gamble
c7307e5a7d find_prev_keyword strips everything after the last keyword 2015-04-06 18:30:05 -04:00
Darik Gamble
1fad19a584 bugfix: extract_tables stopped prematurely on INNER JOIN et al
check for value.endswith('join') instead of just value == 'join'
2015-04-06 06:30:56 -04:00
Darik Gamble
070b138cf3 bugfix: suggestions were broken after specifying a join type
because sqlparse parses things like 'inner join' as a single token, simply checking if token value
matches 'join' fails on further specified join types
2015-04-06 05:52:38 -04:00
Darik Gamble
05dac16040 suggest view names 2015-04-05 16:38:04 -04:00
Darik Gamble
d437f0cabf pgexecute supports returning view metadata
generalize tables() to _relations(relkind_filter), and add convenience methods tables() and views() which simply call _relations() with the appropriate relkind_filter value

similarly, generatize columns() to _columns(relkind_filter), and add convenience methods table_columns() and view_columns()
2015-04-05 16:38:02 -04:00
Amjith Ramanujam
a80eb4ea19 Add a title field and report the notices. Closes #177 2015-03-25 00:26:38 -07:00
Daniel Rocco
9124df2364 Format Decimal values directly as strings
Closes #169
2015-03-11 00:59:36 -04:00
Amjith Ramanujam
55120a9958 Merge pull request #170 from darikg/better_dots
Better handle schema qualifications in current word
2015-03-08 17:50:23 -07:00
Darik Gamble
2b85eaecb0 Better handle schema-qualified word_before_cursor
Previously, if the current word contained a period, `suggest_type` would parse text to the right of the period as `word_before_cursor`, so that characters to the left of the period were parsed as the final token. Then `suggest_based_on_last_token` would generate suggestions under the generic catch-all `elif token_v.endswith('.')`. This means that, for example, `DROP TABLE schema_name.<TAB>` and `DROP FUNCTION schema_name.<TAB>` would each suggest both tables and functions from schema_name.

This commit changes this behavior to include schema qualifications as part of word_before_cursor, so that `suggest_based_on_last_token` operates on the actual preceding token, not just the schema name. This allows each token value to handle schema qualifications differently, and now  `DROP TABLE schema_name.<TAB>`  suggests only tables from schema_name, and the corresponding `DROP FUNCTION` command only functions.
2015-03-06 08:26:41 -05:00
Daniel Rocco
8e919f1b6c Interpret incoming JSON as a string instead of via json.loads
Closes #163
2015-03-01 00:40:46 -05:00
Darik Gamble
bccde788f3 Watch out for leading whitespace 2015-02-28 08:43:34 -05:00
Darik Gamble
687578eafb \dn suggests schemas only 2015-02-27 10:06:44 -05:00
Darik Gamble
5d44904aa3 \df suggests only schemas and functions 2015-02-27 10:04:59 -05:00
Darik Gamble
1fa910b7fd Move pgspecial suggestions to separate method 2015-02-27 10:02:12 -05:00
Amjith Ramanujam
eded02a0a8 Add a test for the special multi-command case. 2015-02-26 23:28:21 -08:00
Daniel Rocco
2f34fbafd6 Only include special command completions at the start of a statement
Closes #159
2015-02-25 16:58:01 -05:00
Daniel Rocco
840f3bd3a8 Add completion for CREATE WITH TEMPLATE
Closes #156
2015-02-24 12:44:32 -05:00
Darik Gamble
22ed9ddb86 Autocomplete function names 2015-02-17 12:35:56 -05:00
Darik Gamble
896297c440 Store function metadata (not used yet) 2015-02-17 11:38:22 -05:00
Amjith Ramanujam
7091dce672 Revert psycopg2cffi to psycopg2. 2015-02-08 14:54:57 -08:00
Amjith Ramanujam
c5c3047b90 Convert to use cffi. But unicode isn't working. 2015-02-06 22:58:59 -08:00
Amjith Ramanujam
f956fa80ea Add a test for the boolean printing. 2015-01-31 16:38:47 -08:00
Amjith Ramanujam
d324b27e41 Replace splat import in tests. 2015-01-30 18:59:09 -08:00
Amjith Ramanujam
cf0f33ff01 Add a test for the unicode handling in unknown types. 2015-01-30 18:15:40 -08:00
darikg
13f84bf83e Fix #106 - autocompletion in multiple statements 2015-01-28 18:21:13 -05:00
Amjith Ramanujam
27a363ee06 Fix broken tests. 2015-01-27 23:12:15 -08:00
Darik Gamble
7d3f276e83 Fix \d special command and add some tests 2015-01-26 08:30:55 -05:00
Darik Gamble
cbca9c62df Split up smart completion tests into two files
One file for simple public schema only tests, and another more focused on schema-aware autocompletion
2015-01-25 16:41:03 -05:00
Darik Gamble
89cffd18ba Fix failing tests in python 3 by converting dictionaries to tuples so sorted can sort them 2015-01-25 13:15:01 -05:00
Darik Gamble
830d1beaa8 Remove pandas dependency by storing database metadata as lists of tuples 2015-01-25 11:39:03 -05:00
Darik Gamble
7e7051fef7 Merge branch 'master' into schema_autocomplete 2015-01-25 11:37:46 -05:00
Amjith Ramanujam
d2c79d8240 Remove the custom parse_dsn function. 2015-01-23 22:31:37 -08:00
Daniel Rocco
52b684574e Cast bytea fields to text for output. 2015-01-21 22:50:24 -05:00
Iryna Cherniavska
13f3af72c3 ON keyword now suggests tables and aliases on the right side of equal sign also. 2015-01-19 17:03:44 -08:00
Darik Gamble
98b064b829 fix schema-handling in tests 2015-01-19 13:04:50 -05:00
Amjith Ramanujam
41927cd8d3 Merge branch 'master' into pr127 2015-01-18 22:08:52 -08:00
Amjith Ramanujam
1e59d7a946 Add tests for auto-escaped tables/columns. 2015-01-18 21:52:25 -08:00
Darik Gamble
8bba43e1d7 Add missing import 2015-01-18 19:04:24 -05:00
Darik Gamble
cc6276925f Get schema names with a direct query instead of stripping them from the tables metadata so we can autocomplete schemata without tables in them 2015-01-18 18:27:25 -05:00
Darik Gamble
78288101c2 Make autocomplete schema-aware 2015-01-18 15:53:47 -05:00
Iryna Cherniavska
c4c61b8ce5 ON keyword suggests either table aliases, or table names. 2015-01-17 22:16:53 -08:00
darikg
ffeb89e406 fix bug where show_help command failed in python 3 due to iteritems() deprecation 2015-01-14 15:19:23 -05:00
Karl-Aksel Puulmann
89547a171e Support having multiple queries on the same line.
Note that if any of the queries raises an error, nothing besides the error is
output. This is different behavior from psql which outputs separately for each
query:

_test_db=# select 1; invalid syntax; select 2;
 ?column?
----------
        1
(1 row)

ERROR:  syntax error at or near "invalid"
LINE 1: invalid syntax;
        ^
 ?column?
----------
        2
(1 row)
2015-01-10 11:55:35 +02:00
Karl-Aksel Puulmann
498257cf37 Fix expanded output package under python 3, add tests for unicode support. 2015-01-09 12:53:42 +02:00
Karl-Aksel Puulmann
b54823c96a Fix problem with travis not using correct python versions when testing. 2015-01-09 12:33:27 +02:00
Karl-Aksel Puulmann
9632546c4b Do only one query for all columns, instead of len(tables) queries. Should fix #25 2015-01-09 00:16:55 -08:00
Karl-Aksel Puulmann
b7f9c00c21 Fix issues pointed out in pull request comments. 2015-01-09 00:14:18 -08:00
Karl-Aksel Puulmann
8307a7e642 Simplistic test 2015-01-09 00:14:18 -08:00
Karl-Aksel Puulmann
a87f3a1fcc Checking if database exists and some initial fixtures which clean up 2015-01-09 00:13:19 -08:00
Stuart Quin
decb370f88 Add test for expected output 2015-01-08 23:38:54 -08:00
Karl-Aksel Puulmann
d566ff3286 Remove the extra tox.ini 2015-01-07 21:55:27 +02:00
Amjith Ramanujam
4e862015f8 Mark the multicolumn sub-select test to xfail. 2015-01-04 23:23:48 -08:00
Amjith Ramanujam
b61663a65c Move parse_dsn tests to test folder instead of doctests. 2015-01-04 16:20:52 -08:00
Amjith Ramanujam
922a74d58a Add tox and fix python3 failures. 2015-01-02 00:04:01 -08:00
Amjith Ramanujam
a4460f17cc Remove the debug statment left in tests. 2015-01-01 00:16:43 -08:00
Amjith Ramanujam
6e622d6dde Add initial completion support for JOIN statements. 2015-01-01 00:07:31 -08:00
Amjith Ramanujam
1cfdb4c55a Extract tables from JOIN statements. 2014-12-31 23:17:50 -08:00
Amjith Ramanujam
16af5d0ec1 Add keyword completion for sub-select. 2014-12-30 21:46:16 -08:00
Amjith Ramanujam
0fa38b0e4f Fix another corner case for table name extraction in nested sql. 2014-12-30 00:22:48 -08:00
Amjith Ramanujam
65c7cdaafa Fix the table extraction for nested select statement. 2014-12-29 21:43:41 -08:00
Iryna Cherniavska
799d4bc35b Added tests for multiple column suggestion, dot and alias. 2014-12-28 14:57:51 -08:00
Iryna Cherniavska
335e57215c added tests for dot and alias 2014-12-27 14:43:49 -08:00
Iryna Cherniavska
5b4644ba34 added naive completion tests 2014-12-27 13:49:35 -08:00
Amjith Ramanujam
665f5e9d0a Remove the debug statmenet. 2014-12-26 00:41:45 -08:00
Amjith Ramanujam
9763ddb95c Fix the table parsing for update and add a test. 2014-12-26 00:32:56 -08:00
Amjith Ramanujam
be322144c3 Fix multiple columns for aliased tables. 2014-12-25 02:08:31 -08:00
Amjith Ramanujam
7492594c37 Improve the Insert completion. 2014-12-25 01:55:00 -08:00
Amjith Ramanujam
09c5f28abe First attempt at dot completion and alias detection. 2014-12-24 23:56:12 -08:00
Amjith Ramanujam
b432811a21 Refactor sqlcompletion to make it work for multiple cols and tables. 2014-12-24 01:32:01 -08:00
Amjith Ramanujam
351686fa33 Make parseutils to work with hanging comma and insert statements. 2014-12-24 00:16:08 -08:00
Iryna Cherniavska
6933b72cb9 added some smart completion tests 2014-12-23 23:59:14 -08:00
Amjith Ramanujam
6a9b224834 Add tests for parse_utils.extract_tables. 2014-12-23 23:29:26 -08:00
Amjith Ramanujam
080675ba0f Add a check for partially entered col name. 2014-12-20 23:38:48 -08:00
Amjith Ramanujam
c6926dda0a Add a test for where clause and rename all tests functions. 2014-12-20 22:28:30 -08:00
Amjith Ramanujam
23f3ae3028 Cleanup sql_completion tests. 2014-12-20 14:18:28 -08:00
Iryna Cherniavska
e287787045 attempt to suggest column name when function is typed 2014-12-18 13:57:40 -08:00
Amjith Ramanujam
1b8d11a3e7 Add default config file to setup.py. 2014-12-11 08:59:42 -08:00
Amjith Ramanujam
e3f7d263f3 Add test plan and place holder stubs. 2014-12-09 23:14:49 -08:00