Files
Files are accessed by a path, which is prefixed with an f to differentiate it from a regular string.
Some examples of file pointers:
To work with the files that can be accessed through these pointers, use the following:
A
DEFINE BUCKETstatement to set up the bucket to hold the filesFiles functions such as
file::put()andfile::get()
Using files for ad-hoc memory storage
A combination of files and SurrealDB's encoding functions can be used to set up ad-hoc memory storage. This can be convenient when running an instance that saves data to disk but prefers to keep certain items in memory.
The following example shows how this pattern might be used for temporary storage such as a user's shopping cart during a single session.