revert(sqlite): remove RC4 Legacy database support
This commit is contained in:
19 files changed
+49
-187
No files matched your search
@@ -1,5 +1,5 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { appendConnectionErrorHints, isSqliteMissingEncryptionPasswordFailure } from "@/lib/connection/connectionErrorHints";
|
||||
import { appendConnectionErrorHints } from "@/lib/connection/connectionErrorHints";
|
||||
import type { ConnectionConfig } from "@/types/database";
|
||||
|
||||
function mysqlConfig(urlParams: string | undefined): ConnectionConfig {
|
||||
@@ -40,14 +40,6 @@ const t = (key: string) => {
|
||||
};
|
||||
|
||||
describe("appendConnectionErrorHints", () => {
|
||||
it("recognizes an encrypted SQLite file that was first opened without a password", () => {
|
||||
const config = { ...mysqlConfig(undefined), db_type: "sqlite" as const, host: "/tmp/encrypted.db", port: 0 };
|
||||
|
||||
expect(isSqliteMissingEncryptionPasswordFailure(config, "Selected file is not a valid SQLite database file.")).toBe(true);
|
||||
expect(isSqliteMissingEncryptionPasswordFailure({ ...config, password: "wrong" }, "Selected file is not a valid SQLite database file.")).toBe(false);
|
||||
expect(isSqliteMissingEncryptionPasswordFailure(config, "SQLite connection failed: unable to open database file")).toBe(false);
|
||||
});
|
||||
|
||||
it("adds a MySQL TLS hint for non-disabled TLS failures", () => {
|
||||
const message = appendConnectionErrorHints(mysqlConfig("ssl-mode=preferred"), "MySQL connection failed: TLS handshake failed", t);
|
||||
|
||||
|
||||
@@ -72,11 +72,6 @@ export function isMysqlMissingPasswordFailure(config: ConnectionConfig, message:
|
||||
return /access denied for user[\s\S]*using password:\s*no/i.test(message);
|
||||
}
|
||||
|
||||
export function isSqliteMissingEncryptionPasswordFailure(config: ConnectionConfig, message: string): boolean {
|
||||
if (config.db_type !== "sqlite" || config.password) return false;
|
||||
return /Selected file is not a valid SQLite database file/i.test(message);
|
||||
}
|
||||
|
||||
export function isJdbcMissingRuntimeDependencyError(message: string): boolean {
|
||||
return /Missing Java class|NoClassDefFoundError|ClassNotFoundException/i.test(message);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user