Skip to content

Commit 84b7385

Browse files
committed
Address comments
1 parent 601ec04 commit 84b7385

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

versioned_docs/version-4.6/developers/applications/data-loader.md renamed to versioned_docs/version-4.6/developers/applications/loading-data.md

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
2-
title: Data Loader
2+
title: Loading Data
33
---
44

5-
# Data Loader
5+
# Loading Data
66

77
Now that you’ve set up your first application, let’s bring it to life with some data. Applications are only as useful as the information they hold, and Harper makes it simple to seed your database with initial records, configuration values, or even test users, without needing to write a custom script. This is where the Data Loader plugin comes in.
88

@@ -68,6 +68,12 @@ curl http://localhost:9926/Dog/
6868

6969
You should see both `Harper` and `Balto` returned as JSON.
7070

71+
:::info
72+
💡 Notice the trailing `/` in the URL (`/Dog/`). This tells Harper to return all records in the table. Leaving it off would look for a single record instead.
73+
74+
For more details on querying tables, resources, and records with the REST plugin, see the [REST reference docs](../../developers/rest).
75+
:::
76+
7177
### Updating Records
7278

7379
What happens if you change the data file? Let’s update Harper’s age from 3 to 4 in `dogs.json.`
@@ -88,18 +94,20 @@ The Data Loader is designed to be safe and repeatable. If a record already exist
8894

8995
### Adding More Tables
9096

91-
If your app grows and you want to seed more than just dogs, you can create additional files. For example, a `settings.yaml` file:
97+
If your app grows and you want to seed more than just dogs, you can create additional files. For example, a `breeds.yaml` file:
9298

9399
```yaml
94100
database: myapp
95-
table: Settings
101+
table: Breed
96102
records:
97103
- id: 1
98-
setting_name: app_name
99-
setting_value: Dog Tracker
104+
name: Labrador
105+
size: Large
106+
lifespan: 12
100107
- id: 2
101-
setting_name: version
102-
setting_value: '1.0.0'
108+
name: Husky
109+
size: Medium
110+
lifespan: 14
103111
```
104112
105113
Then add it to your config:
@@ -108,7 +116,7 @@ Then add it to your config:
108116
dataLoader:
109117
files:
110118
- 'data/dogs.json'
111-
- 'data/settings.yaml'
119+
- 'data/breeds.yaml'
112120
```
113121
114122
Harper will read both files and load them into their respective tables.
@@ -123,3 +131,4 @@ In just a few steps, we’ve gone from an empty Dog table to a real application
123131
124132
- [Data Loader Reference](../../reference/applications/data-loader) – Complete configuration and format options.
125133
- [Bulk Operations](../operations-api/bulk-operations) - For loading data via the Operations API
134+
- [Plugins](../../reference/components/plugins) – For adding custom functionality to applications.

0 commit comments

Comments
 (0)