add mysql, mariadb, postgresql, sqlite volumes support

This commit is contained in:
Renan Bernordi
2025-11-15 23:32:26 -03:00
parent c0bef7f65e
commit eb28667d90
15 changed files with 1022 additions and 25 deletions

View File

@@ -5,6 +5,10 @@ import { makeDirectoryBackend } from "./directory/directory-backend";
import { makeNfsBackend } from "./nfs/nfs-backend";
import { makeSmbBackend } from "./smb/smb-backend";
import { makeWebdavBackend } from "./webdav/webdav-backend";
import { makeMariaDBBackend } from "./mariadb/mariadb-backend";
import { makeMySQLBackend } from "./mysql/mysql-backend";
import { makePostgresBackend } from "./postgres/postgres-backend";
import { makeSQLiteBackend } from "./sqlite/sqlite-backend";
type OperationResult = {
error?: string;
@@ -33,5 +37,20 @@ export const createVolumeBackend = (volume: Volume): VolumeBackend => {
case "webdav": {
return makeWebdavBackend(volume.config, path);
}
case "mariadb": {
return makeMariaDBBackend(volume.config, path);
}
case "mysql": {
return makeMySQLBackend(volume.config, path);
}
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}`);
}
}
};