Skip to content

Commit

Permalink
Add gel as a valid dsn scheme.
Browse files Browse the repository at this point in the history
  • Loading branch information
dnwpark committed Nov 27, 2024
1 parent 62b6474 commit 5b9fe30
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/EdgeDB.Net.Driver/EdgeDBConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ internal bool ValidateServerCertificateCallback(object sender, X509Certificate?
/// <inheritdoc />
public override string ToString()
{
var str = "edgedb://";
var str = "gel://";

if (Username is not null)
str += Username;
Expand Down Expand Up @@ -269,8 +269,8 @@ public string CloudProfile
/// <exception cref="KeyNotFoundException">An environment variable couldn't be found.</exception>
public static EdgeDBConnection FromDSN(string dsn)
{
if (!dsn.StartsWith("edgedb://"))
throw new ConfigurationException("DSN schema 'edgedb' expected but got 'pq'");
if (!dsn.StartsWith("edgedb://") && !dsn.StartsWith("gel://"))
throw new ConfigurationException("DSN schema 'gel' expected but got 'pq'");

string? database = null, username = null, port = null, host = null, password = null;

Expand Down Expand Up @@ -644,7 +644,7 @@ public static EdgeDBConnection Parse(string? instance = null, string? dsn = null

// try to resolve the toml, don't do this for cloud-like conn params.
if (autoResolve && !((instance is not null && instance.Contains('/')) ||
(dsn is not null && !dsn.StartsWith("edgedb://"))))
(dsn is not null && !dsn.StartsWith("edgedb://") && !dsn.StartsWith("gel://"))))
{
try
{
Expand Down

0 comments on commit 5b9fe30

Please sign in to comment.