ErrorsEntities, stores and migrations · rule
data.store_required
An entity names no database to live in, and the app declares databases but none called main.
Area 5, Entities, stores and migrations; not declinable; the next step is usually the human's.
Why Jadpo refuses it
An entity lives in the main database unless its file says
store: <connection>. With no database declared, main is a PostgreSQL
database you don't have to declare. Once app.jadpo declares databases of
its own, main is no longer implied, so an entity that names no store has
nowhere to go.
Jadpo won't pick one of your databases for the entity, because that decides where its records are kept.
What it looks like
app.jadpo declares one database, archive:
domains/notes/entities/note.jadpo:
entity Note { id: Uuid}
error Note names no store, and there is no main
--> domains/notes/entities/note.jadpo:1:8
|1 | entity Note { | ^^^^ which store?
- reason
- An entity lives in
mainunless its file saysstore: <connection>, andapp.jadpodeclares no database calledmain; its databases arearchive. - next
- Add
store: archivetoNote(human) - rule
- data.
store_ required - help
- https://jadpo.
dev/docs/errors/data. store_ required
(human) at the end of the next: line tells your coding agent to stop
and ask you which fix you want, because the choice is yours to make: it
decides which database keeps notes.
How to fix it
If notes belong in archive, say so in the entity.
domains/notes/entities/note.jadpo becomes:
entity Note { id: Uuid store: archive}
Notes are kept in the archive database.
If notes belong in a database of their own, declare main beside
archive in app.jadpo:
main: { driver: Driver.postgres }
Notes, and every other entity that names no store, are kept in main.
Related
Markdown for agents: /docs/errors/data.store_required.md.Built from Jadpo main at aee2e8f.