frigjord
frigjord14mo ago

How can i change the location of Cache.open('somedb')

We're deploying to docker containers which needs to write to an attached volume (specific path)
2 Replies
Deno AI Helper
Deno AI Helper14mo ago
The documentation does not provide a specific method to change the location of Cache.open('somedb') in Deno. The Cache API is part of the Fetch API, and it's typically used for storing and retrieving network requests and their corresponding responses. However, if you're looking to change the location of a database file or any other type of file, you can use the Deno APIs for file system operations. For example, you can use Deno.rename to move a file from one location to another. Here's an example from the documentation:
await Deno.rename("./old/path", "./new/path");
await Deno.rename("./old/path", "./new/path");
In this example, ./old/path is the current location of the file, and ./new/path is the new location where you want to move the file. Please note that this operation requires both --allow-read and --allow-write permissions. If you're working with a database and you want to change its location, you would typically specify the new location when you're initializing the database. The exact method to do this would depend on the specific database technology you're using. Remember, this information is not explicitly stated in the documentation for changing the location of Cache.open('somedb').
frigjord
frigjordOP14mo ago
I checked the Deno source, only tmp is implemented.