diff --git a/edgedb/con_utils.py b/edgedb/con_utils.py index 78a450be..285790fc 100644 --- a/edgedb/con_utils.py +++ b/edgedb/con_utils.py @@ -706,6 +706,12 @@ def _parse_connect_dsn_and_args( f'project defined cloud profile ("{cloud_profile}")' ), ) + + opt_database_file = os.path.join(stash_dir, 'database') + if os.path.exists(opt_database_file): + with open(opt_database_file, 'rt') as f: + database = f.read().strip() + resolved_config.set_database(database, "project") else: raise errors.ClientConnectionError( f'Found `edgedb.toml` but the project is not initialized. ' diff --git a/tests/shared-client-testcases b/tests/shared-client-testcases index f16d2c17..b8959be8 160000 --- a/tests/shared-client-testcases +++ b/tests/shared-client-testcases @@ -1 +1 @@ -Subproject commit f16d2c17f502ad5bd5c35d8872cd5dc962d0fb7e +Subproject commit b8959be8968aceeeac2af3da7639de02b19d7030 diff --git a/tests/test_con_utils.py b/tests/test_con_utils.py index 742391ba..c2820a6e 100644 --- a/tests/test_con_utils.py +++ b/tests/test_con_utils.py @@ -32,6 +32,7 @@ class TestConUtils(unittest.TestCase): + maxDiff = 1000 error_mapping = { 'credentials_file_not_found': ( @@ -184,6 +185,9 @@ def run_testcase(self, testcase): if 'cloud-profile' in v: profile = os.path.join(dir, 'cloud-profile') files[profile] = v['cloud-profile'] + if 'database' in v: + database_file = os.path.join(dir, 'database') + files[database_file] = v['database'] del files[f] es.enter_context(