Local queries (#641)

* Read local queries from pgweb home directory
* Refactor local query functionality
* Allow picking local query in the query tab
* WIP
* Disable local query dropdown during execution
* Only allow local queries running in a single session mode
* Add middleware to enforce local query endpoint availability
* Fix query check
* Add query store tests
* Make query store errors portable
* Skip building specific tests on windows
This commit is contained in:
Dan Sosedoff
2023-02-02 16:13:14 -06:00
committed by GitHub
parent 1c3ab1fd1c
commit 41bf189e6b
23 changed files with 884 additions and 12 deletions

View File

@@ -660,6 +660,15 @@ func testTablesStats(t *testing.T) {
assert.Equal(t, columns, result.Columns)
}
func testConnContext(t *testing.T) {
result, err := testClient.GetConnContext()
assert.NoError(t, err)
assert.Equal(t, "localhost", result.Host)
assert.Equal(t, "postgres", result.User)
assert.Equal(t, "booktown", result.Database)
assert.Equal(t, "default", result.Mode)
}
func TestAll(t *testing.T) {
if onWindows() {
t.Log("Unit testing on Windows platform is not supported.")
@@ -698,6 +707,7 @@ func TestAll(t *testing.T) {
testReadOnlyMode(t)
testDumpExport(t)
testTablesStats(t)
testConnContext(t)
teardownClient()
teardown(t, true)