Diagnostic error: Database.batch() can only be called from inside of an Action, but documentation says this should be possible
See original GitHub issueI’m getting the following error when trying to call batch on a database directly:
Diagnostic error: Database.batch() can only be called from inside of an Action. See docs for more details.
However, in the docs it says that batch can be called outside of an Action:
Call await this.batch in the Action (outside of actions, you can also call .batch() on the Database object)
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Changelog - WatermelonDB documentation - GitHub Pages
Read-only records that cannot be saved in the database, updated, or deleted and only exist for as long as you keep a reference...
Read more >WatermelonDB - Error when performing batch insertion
When I use batch to insert new records to the table, from a component, I get the error TypeError: Cannot read property 'id'...
Read more >Database Engine events and errors - SQL Server
Consult this MSSQL error code list to find explanations for error messages for SQL Server database engine events.
Read more >Bulk API | Elasticsearch Guide [8.5] | Elastic
To update or delete a document in a data stream, you must target the backing index ... Each index and delete action within...
Read more >Troubleshoot Dataflow errors | Google Cloud
They can also indicate conditions that prevent the normal logging path from functioning. Your pipeline might throw exceptions while processing data. Some of ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

No. All database write operations (batch, create, update, delete) must be wrapped in an action. And you can make an action in two ways: explicitly using
database.action()block or by marking a function using@actiondecoratorsame question here. kinda confusing by the way it’s wrote! it would be cool unmark the “wontfix” and have a look 😃 edit: thanks stale bot, hehe