Commit Graph

63 Commits

Author SHA1 Message Date
Dan Sosedoff
4c40eef99a
Perform client version validation before executing pg_dump command (#614)
* Add func to parse out pg_dump version
* Perform client vs server version checking before dump exports
* Fix dump tests
* Add extra test to validate against empty server version
* Fix attachment filenames cleanup function
* Add extra test
* Fix small typos in comments
* Drop third-party package to deal with versions
* Tweak the pg dump incompatibility error message
* Run CI on pull requests
2022-12-12 15:09:12 -06:00
Dan Sosedoff
0008842a68
Add test for server type and version detection (#612) 2022-12-08 13:33:38 -06:00
Dan Sosedoff
d08dbf34aa
Implement global query timeout option (#609)
* Add global query timeout
* Tweak option settings
* Add timeout test
* Move query timeout option close to idle timeout
2022-12-07 18:56:58 -06:00
Dan Sosedoff
38051b9465
Add support for user functions (#608)
* Add initial support for functions
* Show functions definitions
* Fix client tests
* Fix schema objects search
* Perform partial matching for functions
* Add function test
* Make sure to close client connections so that database could be dropped in tests
* Fix lint
* Allow to copy the view/functions definitions
* Nits
2022-12-07 11:58:07 -06:00
Dan Sosedoff
450badfbbb
Handle returning values in update/delete queries 2022-12-05 20:56:21 -06:00
Dan Sosedoff
16726e2461
Add idle timeout into session manager 2022-12-02 14:20:20 -06:00
Dan Sosedoff
73dfcc46c3
Verify client is closed 2022-12-02 13:59:22 -06:00
Dan Sosedoff
9074d4bfb8
Add internal sessions manager 2022-12-02 13:36:31 -06:00
Dan Sosedoff
706caa44bf
Serialize binary bytea cols into hex/base64 (#537)
- Adds binary serialization into hex/base64
- Default codec is base64
- Codec can be changed via `--binary-codec` CLI option
2021-12-29 11:03:50 -06:00
Dan Sosedoff
40eb74529e Reject queries that contain restricted keywords in read-only mode 2019-02-20 18:20:27 -06:00
Dan Sosedoff
5af4332593 Fix SQL query for camelCase tables row estimation 2019-02-08 13:27:40 -06:00
Dan Sosedoff
2bd9f39da5 Fix SSH error: ssh: must specify HostKeyCallback 2018-12-14 19:56:33 -06:00
Dan Sosedoff
c9d94b54d7
Merge pull request #394 from sosedoff/fix-row-estimation
Fix row estimation bug
2018-12-12 14:33:06 -06:00
Dan Sosedoff
7917c2ad35 Simplify TableRowsCount func logic 2018-12-12 13:56:08 -06:00
Dan Sosedoff
2db5ce544f Fix row estimation bug
The variable `table` is mutated from `schema.tablename` to `tablename`
before being passed to other functions, which try to parse the schema
from the name. This results in schema name being `public` because it's
missing from the given table name.
2018-12-12 13:33:55 -06:00
Dan Sosedoff
474b99c6d5 Print out failed query SQL and args with --debug flag 2018-12-12 13:22:36 -06:00
Dan Sosedoff
dc4e8598f7 Refactor building connection string from options 2018-09-13 22:44:11 -05:00
Eric Dagenais
9bb3afe6ce Merge remote-tracking branch 'upstream/master' into itn/tables-quotes-2
# Conflicts:
#	pkg/client/client.go
2018-06-20 07:19:34 -07:00
Allisson Azevedo
808f6eea33 Change EstimatedTableRowsCount query 2018-06-16 18:12:11 -03:00
Allisson Azevedo
8748f07167 Use EstimatedTableRowsCount only for postgresql 2018-06-14 16:36:22 -03:00
Allisson Azevedo
d603b293d8 Add EstimatedTableRowsCount to avoid count in large tables 2018-06-14 16:10:59 -03:00
Dan Sosedoff
108754a8c3 Verify that database name is specified when opening the connection 2018-06-05 22:31:22 -05:00
Dan Sosedoff
1cbcb73948 Print a correct database server name when starting 2018-06-05 18:28:22 -05:00
Dan Sosedoff
e09f892442 Fix table info call, just return placeholder for now 2018-06-05 16:38:00 -05:00
Dan Sosedoff
56f3b45a4e Fix activity list 2018-06-05 15:48:16 -05:00
Dan Sosedoff
77770112bd Detect server type and version with regular expression 2018-06-05 15:35:19 -05:00
Eric Dagenais
7b3e99b599 fixes issue that generates an error message when getting table info, getting table schema, and exporting data for tables with uppercase letters 2018-04-11 06:24:56 -07:00
Dan Sosedoff
47500bf92e Specs refactor and tweaks
- Make ParseOptions func to take an arg and return struct so we can test it
- Refactor and add more tests for options parsing
- Run test suite on postgres 10.x branch
- Change format for connection idle timer from float64 to in
2018-02-22 14:20:18 -06:00
ldinc
38a3f01868 #282: set flag idle logic to cli-run phase 2017-10-15 01:39:07 +03:00
ldinc
d4dde3fe4f #282 fix disabled state per idle timeout 2017-10-14 03:15:31 +03:00
ldinc
3067b06bf6 #282: added timeout flags & tuned client.IsIdle() 2017-10-14 03:08:04 +03:00
Dan Sosedoff
b1dd4b5308 Add new CLI option to disable SSH connections 2017-09-26 23:56:27 -05:00
Dan Sosedoff
62d88121cd Automatically close idle sessions 2017-09-22 22:44:32 -05:00
Dan Sosedoff
73816ff2d7 Add ability to connect with settings from third-party backend 2017-09-19 00:43:21 -05:00
Dan Sosedoff
6ab30ed308 Update the client last usage timestamp 2017-09-14 00:16:40 -05:00
Dan Sosedoff
af7e504e4f Print postgres version on start in a single-session mode 2017-09-13 23:42:44 -05:00
Dan Sosedoff
c592d0063d Set activity queries for different pg versions 2017-05-09 22:51:26 -05:00
Dan Sosedoff
e9787440fb Set server version for the client on start up 2017-05-09 21:53:24 -05:00
Dan Sosedoff
2d2bd1d0b1 Add test to verify readonly mode 2016-11-05 17:51:34 -05:00
Dan Sosedoff
661fed0dbb Set default transaction mode to read only with --readonly flag 2016-11-05 17:43:30 -05:00
Dan Sosedoff
d0d84a62cd Add escaping to order statement 2016-11-03 19:56:55 -05:00
Dan Sosedoff
1f39c2e229 Lint: Fix sql statements naming 2016-09-01 10:05:46 -05:00
Dan Sosedoff
4b4f778360 Return number of affected rows if sql query is update or delete 2016-02-18 22:36:01 -06:00
Dan Sosedoff
bd207a3551 Fix js error when custom sql query returns no results 2016-01-20 09:21:31 -06:00
Dan Sosedoff
9bfaae7194 Merge with master 2016-01-17 15:22:33 -06:00
Dan Sosedoff
4844270f0b Return empty rows collection if query does not have any rows 2016-01-17 15:05:57 -06:00
Dan Sosedoff
3167d96cfc use a different query to fetch materialized view structure 2016-01-17 15:00:33 -06:00
Dan Sosedoff
983f285373 Point db to local tunnel if ssh is enabled 2016-01-14 21:14:45 -06:00
Dan Sosedoff
f0f447857f Tunnel implementation, allow using ssh on connection screen 2016-01-14 19:50:01 -06:00
Dan Sosedoff
68c2b4d084 Initial ssh tunnel implementation 2016-01-13 01:29:14 -06:00