diff --git a/app/client/components/create-volume-form.tsx b/app/client/components/create-volume-form.tsx index 7a1c06f..b5788c4 100644 --- a/app/client/components/create-volume-form.tsx +++ b/app/client/components/create-volume-form.tsx @@ -40,7 +40,6 @@ const defaultValuesForType = { mariadb: { backend: "mariadb" as const, port: 3306 }, mysql: { backend: "mysql" as const, port: 3306 }, postgres: { backend: "postgres" as const, port: 5432, dumpFormat: "custom" as const }, - sqlite: { backend: "sqlite" as const, path: "/" }, }; export const CreateVolumeForm = ({ onSubmit, mode = "create", initialValues, formId, loading, className }: Props) => { @@ -139,7 +138,6 @@ export const CreateVolumeForm = ({ onSubmit, mode = "create", initialValues, for MariaDB MySQL PostgreSQL - SQLite Choose the storage backend for this volume. @@ -798,38 +796,7 @@ export const CreateVolumeForm = ({ onSubmit, mode = "create", initialValues, for > )} - {watchedBackend === "sqlite" && ( - { - return ( - - Database File Path - - {field.value ? ( - - - Selected database: - {field.value} - - field.onChange("")}> - Change - - - ) : ( - field.onChange(path)} selectedPath={field.value} /> - )} - - Path to the SQLite database file (.db, .sqlite, .sqlite3). - - - ); - }} - /> - )} - - {watchedBackend !== "directory" && watchedBackend !== "sqlite" && ( + {watchedBackend !== "directory" && ( { case "postgres": { return makePostgresBackend(volume.config, path); } - case "sqlite": { - return makeSQLiteBackend(volume.config, path); - } default: { throw new Error(`Unsupported backend type: ${(volume.config as any).backend}`); } diff --git a/app/server/modules/backends/sqlite/sqlite-backend.ts b/app/server/modules/backends/sqlite/sqlite-backend.ts deleted file mode 100644 index 21ef630..0000000 --- a/app/server/modules/backends/sqlite/sqlite-backend.ts +++ /dev/null @@ -1,57 +0,0 @@ -import * as fs from "node:fs/promises"; -import { toMessage } from "../../../utils/errors"; -import { logger } from "../../../utils/logger"; -import { testSQLiteConnection } from "../../../utils/database-dump"; -import type { VolumeBackend } from "../backend"; -import { BACKEND_STATUS, type BackendConfig } from "~/schemas/volumes"; - -const mount = async (config: BackendConfig, volumePath: string) => { - if (config.backend !== "sqlite") { - return { status: BACKEND_STATUS.error, error: "Invalid backend type" }; - } - - logger.info(`Testing SQLite connection to: ${config.path}`); - - try { - await testSQLiteConnection(config); - await fs.mkdir(volumePath, { recursive: true }); - - logger.info("SQLite connection successful"); - return { status: BACKEND_STATUS.mounted }; - } catch (error) { - logger.error("Failed to access SQLite database:", error); - return { status: BACKEND_STATUS.error, error: toMessage(error) }; - } -}; - -const unmount = async (volumePath: string) => { - logger.info("Cleaning up SQLite dump directory"); - - try { - await fs.rm(volumePath, { recursive: true, force: true }); - return { status: BACKEND_STATUS.unmounted }; - } catch (error) { - logger.warn(`Failed to clean up SQLite dump directory: ${toMessage(error)}`); - return { status: BACKEND_STATUS.unmounted }; - } -}; - -const checkHealth = async (config: BackendConfig) => { - if (config.backend !== "sqlite") { - return { status: BACKEND_STATUS.error, error: "Invalid backend type" }; - } - - try { - await testSQLiteConnection(config); - return { status: BACKEND_STATUS.mounted }; - } catch (error) { - logger.error("SQLite health check failed:", error); - return { status: BACKEND_STATUS.error, error: toMessage(error) }; - } -}; - -export const makeSQLiteBackend = (config: BackendConfig, volumePath: string): VolumeBackend => ({ - mount: () => mount(config, volumePath), - unmount: () => unmount(volumePath), - checkHealth: () => checkHealth(config), -}); \ No newline at end of file