Skip to content

Commit

Permalink
add support for project database
Browse files Browse the repository at this point in the history
  • Loading branch information
nsidnev committed Sep 27, 2023
1 parent 8e42f03 commit 8eb07bc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
10 changes: 10 additions & 0 deletions lib/edgedb/connection/config.ex
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,16 @@ defmodule EdgeDB.Connection.Config do
project_opts
end

database_path = @path_module.join(stash_dir, "database")

project_opts =
if @file_module.exists?(database_path) do
database = @file_module.read!(database_path)
Keyword.merge(project_opts, database: database)
else
project_opts
end

{resolved_opts, _compounds} = resolve_opts(resolved_opts, project_opts)

resolved_opts
Expand Down
2 changes: 1 addition & 1 deletion test/support/shared-client-testcases
2 changes: 2 additions & 0 deletions test/support/shared_case.ex
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,14 @@ defmodule Tests.Support.SharedCase do
dir = String.replace(file, "${HASH}", hash)
instance = Path.join(dir, "instance-name")
profile = Path.join(dir, "cloud-profile")
database = Path.join(dir, "database")
project = Path.join(dir, "project-path")

files
|> Map.put(dir, "")
|> Map.put(instance, data["instance-name"])
|> Map.put(profile, data["cloud-profile"])
|> Map.put(database, data["database"])
|> Map.put(project, data["project-path"])
else
Map.put(files, file, data)
Expand Down

0 comments on commit 8eb07bc

Please sign in to comment.