You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
'Once there were four children whose names were Peter, Susan, Edmund, and Lucy.'
52
56
```
53
57
54
-
If no backend is selected, the database will search for the environment variable `SURREAL_GLOBAL_BUCKET` and assign this as the global bucket. In this case, files will have a `namespace/database` prefix added (e.g. `my_global_bucket:/test_ns/test_db/somefile.txt`). A second `SURREAL_GLOBAL_BUCKET_ENFORCED` environment variable can also be used, which when set to `true` will enforce usage of the global bucket.
58
+
### File backend
59
+
60
+
A file backend can be chosen for a bucket by typing `"file:"` and then the rest of the path, if necessary.
A check will then be made to see if the `SURREAL_FILE_ALLOWLIST` environment variable contains the path, without which the following error will be generated.
68
+
69
+
```surql
70
+
'Bucket backend not supported: Path not allowed'
71
+
```
72
+
73
+
The following command can be used to start running an instance in which a bucket with a file backend can be defined.
A global backend can also be selected, allowing all namespaces and databases access to the same file storage.
87
+
88
+
If no backend is selected, the database will search for the environment variable `SURREAL_GLOBAL_BUCKET` and assign this as the global bucket. In this case, files will have a `namespace/database` prefix added (e.g. `my_global_bucket:/test_ns/test_db/somefile.txt`). A second `SURREAL_GLOBAL_BUCKET_ENFORCED` environment variable can also be used, which when set to `true` will enforce usage of the global bucket.
89
+
90
+
If a global backend is set, then a `DEFINE BUCKET` statement can be as short as `DEFINE BUCKET` plus its local name, as the rest of the logic is done via environment variables.
91
+
60
92
```surql
93
+
DEFINE BUCKET my_bucket;
94
+
61
95
-- Writes to e.g. `my_global_bucket:/test_ns/test_db/my_bucket/my_book.txt`
62
96
f"my_bucket:/my_book.txt".put("Once there were four children whose names were Peter, Susan, Edmund, and Lucy.");
0 commit comments