mirror of
https://github.com/getredash/redash.git
synced 2025-12-19 17:37:19 -05:00
PostgreSQL: allow connection parameters to be specified (#7579)
As documented in https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-PARAMKEYWORDS Multiple parameters are separated by a space.
This commit is contained in:
@@ -1,6 +1,16 @@
|
||||
from unittest import TestCase
|
||||
|
||||
from redash.query_runner.pg import build_schema
|
||||
from redash.query_runner.pg import _parse_dsn, build_schema
|
||||
|
||||
|
||||
class TestParameters(TestCase):
|
||||
def test_parse_dsn(self):
|
||||
configuration = {"dsn": "application_name=redash connect_timeout=5"}
|
||||
self.assertDictEqual(_parse_dsn(configuration), {"application_name": "redash", "connect_timeout": "5"})
|
||||
|
||||
def test_parse_dsn_not_permitted(self):
|
||||
configuration = {"dsn": "password=xyz"}
|
||||
self.assertRaises(ValueError, _parse_dsn, configuration)
|
||||
|
||||
|
||||
class TestBuildSchema(TestCase):
|
||||
|
||||
Reference in New Issue
Block a user