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

50 Commits

Author SHA1 Message Date
Foxygrandpa
fa4ebb5660 master: numbers division for int and float 2016-09-15 20:55:42 +03: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
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
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
Amjith Ramanujam
0524e0adbf Disable the test for unicode notices. 2016-05-17 12:04:30 -07: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
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
Stuart Quin
37c10e45c8 Issue #448 extension for BC dates 2016-02-03 10:57:36 +00:00
Amjith Ramanujam
c4557a8215 Add a test case for enum unicode case. 2016-01-12 04:55:42 -08:00
Darik Gamble
c9b55ba12e Fix pgexecute tests 2015-10-28 10:58:25 -04:00
Darik Gamble
947cdb9506 support different error-handling options 2015-10-10 15:05:30 -04:00
Darik Gamble
07030e20d2 Move FunctionMetadata definition into its own package 2015-09-29 09:07:20 -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
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
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
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
Darik Gamble
4e46c01d3c Gross test that \dt, \df etc. run without error 2015-05-23 08:33:42 -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
Iryna Cherniavska
dc3f094b1b Implemented external editor call. 2015-04-20 09:11:36 -07:00
Darik Gamble
41007c549e bugfix: don't exclude any schemata from metadata queries 2015-04-09 13:00:57 -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
Daniel Rocco
9124df2364 Format Decimal values directly as strings
Closes #169
2015-03-11 00:59:36 -04: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
Amjith Ramanujam
eded02a0a8 Add a test for the special multi-command case. 2015-02-26 23:28:21 -08: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
cf0f33ff01 Add a test for the unicode handling in unknown types. 2015-01-30 18:15:40 -08: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
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
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
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
Amjith Ramanujam
b61663a65c Move parse_dsn tests to test folder instead of doctests. 2015-01-04 16:20:52 -08:00
Amjith Ramanujam
e3f7d263f3 Add test plan and place holder stubs. 2014-12-09 23:14:49 -08:00