Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add gel as a valid dsn scheme. #37

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,8 @@ protected void setCloudProfile(@Nullable String cloudProfile) {
* @throws IOException A file argument within the DSN cannot be found or be read.
*/
public static @NotNull EdgeDBConnection fromDSN(@NotNull String dsn) throws ConfigurationException, IOException {
if (!dsn.startsWith("edgedb://")) {
throw new ConfigurationException(String.format("DSN schema 'edgedb' expected but got '%s'", dsn.split("://")[0]));
if (!dsn.startsWith("edgedb://") && !dsn.startsWith("gel://")) {
throw new ConfigurationException(String.format("DSN schema 'gel' expected but got '%s'", dsn.split("://")[0]));
}

String database = null, username = null, port = null, host = null, password = null;
Expand Down Expand Up @@ -765,7 +765,7 @@ public static EdgeDBConnection parse(

boolean isDSN = false;

if (autoResolve && !((connParam != null && connParam.contains("/")) || (connParam != null && !connParam.startsWith("edgedb://")))) {
if (autoResolve && !((connParam != null && connParam.contains("/")) || (connParam != null && !connParam.startsWith("edgedb://") && !connParam.startsWith("gel://")))) {
try {
connection = connection.mergeInto(resolveEdgeDBTOML());
} catch (IOException x) {
Expand Down Expand Up @@ -1017,7 +1017,7 @@ private static void setArgument(@NotNull EdgeDBConnection connection, @NotNull S
*/
@Override
public @NotNull String toString() {
var sb = new StringBuilder("edgedb://");
var sb = new StringBuilder("gel://");

this.getUsername();
sb.append(this.getUsername());
Expand Down