Skip to content

Commit a2c75c1

Browse files
committed
Revert "#17 Added turso libsql url support (#22)"
This reverts commit 221cc34.
1 parent 221cc34 commit a2c75c1

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

com.dbeaver.jdbc.driver.libsql/src/main/java/com/dbeaver/jdbc/driver/libsql/LibSqlConstants.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,8 @@
2020

2121
public class LibSqlConstants {
2222

23-
public static final String CONNECTION_URL_EXAMPLES = "jdbc:dbeaver:libsql:<hostname>, libsql://<hostname>";
24-
public static final String CONNECTION_PROTOCOLS_REGEXP = "jdbc:dbeaver:libsql:(https://)?(libsql://)?|libsql://";
25-
public static final Pattern CONNECTION_URL_PATTERN =
26-
Pattern.compile("(" + CONNECTION_PROTOCOLS_REGEXP + ")[a-z0-9.-]+");
23+
public static final Pattern CONNECTION_URL_EXAMPLE = Pattern.compile("jdbc:dbeaver:libsql:<server-url>");
24+
public static final Pattern CONNECTION_URL_PATTERN = Pattern.compile("jdbc:dbeaver:libsql:(.+)");
2725

2826
public static final int DRIVER_VERSION_MAJOR = 1;
2927
public static final int DRIVER_VERSION_MINOR = 0;

com.dbeaver.jdbc.driver.libsql/src/main/java/com/dbeaver/jdbc/driver/libsql/LibSqlDriver.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,9 @@ public Connection connect(String url, Properties info) throws SQLException {
4646
if (!matcher.matches()) {
4747
throw new LibSqlException(
4848
"Invalid connection URL: " + url +
49-
".\nExpected URL formats: " + LibSqlConstants.CONNECTION_URL_EXAMPLES);
49+
".\nExpected URL format: " + LibSqlConstants.CONNECTION_URL_EXAMPLE);
5050
}
51-
String targetUrl = matcher.group(0)
52-
.replaceAll(LibSqlConstants.CONNECTION_PROTOCOLS_REGEXP, "https://");
51+
String targetUrl = matcher.group(1);
5352

5453
Map<String, Object> props = new LinkedHashMap<>();
5554
for (Enumeration<?> pne = info.propertyNames(); pne.hasMoreElements(); ) {

0 commit comments

Comments
 (0)