Skip to content

Commit 375981c

Browse files
committed
docs: documenting missing sandbox preferences (external-db, seed-data) and clarifying around use of .mjs and .cjs files for seed data introduced via architect/sandbox#739
1 parent b6e1956 commit 375981c

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

src/views/docs/en/reference/cli/sandbox.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ You can set a custom port by using an environment variable: `ARC_TABLES_PORT=555
178178

179179
### Database seed data
180180

181-
You can automatically seed data to Sandbox upon startup by adding a `sandbox-seed.js` or `sandbox-seed.json` file to the root of your project. (You can also specify a custom path with the `seed-data` preference.)
181+
You can automatically seed data to Sandbox upon startup by adding a `sandbox-seed.[c|m]js` or `sandbox-seed.json` file to the root of your project. (You can also specify a custom path with [the `seed-data` preference](../configuration/local-preferences#seed-data---string).)
182182

183183
Your seed data should be an object whose properties correspond to `@tables` names, and have arrays of rows to seed. For example:
184184

@@ -205,6 +205,16 @@ module.exports = {
205205
}
206206
]
207207
}
208+
// sandbox-seed.mjs
209+
export default {
210+
things: [
211+
{
212+
id: 'foo',
213+
sort: 'bar',
214+
arbitrary: 'data',
215+
}
216+
]
217+
}
208218
```
209219

210220
The above example would add the two rows above to the `things` database each time Sandbox is started.

src/views/docs/en/reference/configuration/local-preferences.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,15 @@ Advanced option: override the local environment to use `staging` or `production`
115115
env staging
116116
```
117117

118+
### `external-db` - Boolean
119+
120+
Use an external database instead of Sandbox's built-in dynalite DynamoDB simulator. Useful if you'd rather work with a separate tool like [AWS NoSQL Workbench](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/workbench.html).
121+
122+
```arc
123+
@sandbox
124+
external-db true
125+
```
126+
118127
### `useAWS` - Boolean
119128

120129
Advanced option that instruct [Sandbox][sandbox] to use live AWS infrastructure where deployed, specifically: [`@tables`][tables] / [`@tables-indexes`][indexes] (DynamoDB), [`@events`][events] (EventBridge), and [`@queues`][queues] (SQS). Defaults to `false`. Notes:
@@ -135,6 +144,15 @@ Disables [hydration][hydrate]. Defaults to `false`.
135144
no-hydrate true
136145
```
137146

147+
### `seed-data` - String
148+
149+
Specifies a custom file path to [Sandbox database seed data](../cli/sandbox#database-seed-data).
150+
151+
```arc
152+
@sandbox
153+
seed-data scripts/sandbox-database-seed.mjs
154+
```
155+
138156
## `@sandbox-start`
139157

140158
Hook up CLI commands into [Sandbox][sandbox] startup. Helpful for repetitive tasks like seeding a database or starting up additional services for local development. Each command should be a separate unindented line under the `@sandbox-start` pragma.

0 commit comments

Comments
 (0)