{"record":{"id":"f498d615c8cf7149","repo":"tursodatabase/turso","slug":"deleting-a-direct-remote-turso-database-is-not-supported-use","errorCode":null,"errorMessage":"Deleting a direct remote Turso database is not supported. Use the Turso platform API to delete the remote database.","messagePattern":"Deleting a direct remote Turso database is not supported\\. Use the Turso platform API to delete the remote database\\.","errorType":"validation","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"bindings/dotnet/src/Turso.EntityFrameworkCore.Sqlite/Storage/Internal/TursoSqliteDatabaseCreator.cs","lineNumber":239,"sourceCode":"            relationalConnection,\n            null,\n            null,\n            null,\n            Dependencies.CommandLogger,\n            CommandSource.Migrations);\n\n    private static bool IsMemory(TursoSqliteConnectionStringBuilder options)\n        => options.IsLocal\n            && (options.DataSource.Equals(\":memory:\", StringComparison.OrdinalIgnoreCase)\n                || options.Mode == TursoSqliteOpenMode.Memory)\n           || options.IsReplica\n            && options.ReplicaPath.Equals(\":memory:\", StringComparison.OrdinalIgnoreCase);\n\n    private static void ThrowIfDirectRemoteDelete(TursoSqliteConnectionStringBuilder options)\n    {\n        if (options.IsDirectRemote)\n        {\n            throw new NotSupportedException(\n                \"Deleting a direct remote Turso database is not supported. \"\n                + \"Use the Turso platform API to delete the remote database.\");\n        }\n    }\n\n    private static void DeleteDatabaseFiles(string path, bool includeReplicaSidecars)\n    {\n        if (string.IsNullOrWhiteSpace(path)\n            || path.Equals(\":memory:\", StringComparison.OrdinalIgnoreCase))\n        {\n            return;\n        }\n\n        TursoSqliteConnection.ClearAllPools();\n        var fullPath = Path.GetFullPath(path);\n        File.Delete(fullPath);\n        File.Delete(fullPath + \"-journal\");\n        File.Delete(fullPath + \"-wal\");","sourceCodeStart":221,"sourceCodeEnd":257,"githubUrl":"https://github.com/tursodatabase/turso/blob/492c4a71cd7c2649e7df83da1471b74f4b1c7aa9/bindings/dotnet/src/Turso.EntityFrameworkCore.Sqlite/Storage/Internal/TursoSqliteDatabaseCreator.cs#L221-L257","documentation":"Guard inside TursoSqliteDatabaseCreator's delete path (ThrowIfDirectRemoteDelete, called from Delete/DeleteAsync). EF Core's Database.EnsureDeleted/Migrate pipeline calls this creator to drop the database; when the connection is a direct remote Turso database, dropping the whole database cannot be done via the client-side SQLite delete semantics, so the creator refuses instead of issuing an unsupported destructive operation against the remote platform. It fires whenever a delete of a database is requested while the connection string points directly at a remote Turso database.","triggerScenarios":"Thrown at bindings/dotnet/src/Turso.EntityFrameworkCore.Sqlite/Storage/Internal/TursoSqliteDatabaseCreator.cs:239 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Delete the remote database through the Turso platform API (e.g. `turso db destroy`) instead of EnsureDeleted/Delete","Point the connection string at a local database if client-side delete is required","Recreate/reuse an existing remote database rather than deleting and recreating it"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"492c4a71cd7c2649e7df83da1471b74f4b1c7aa9","analyzedAt":"2026-09-13T18:13:59.796Z","contentChangedAt":"2026-09-13T18:13:59.796Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}