No error in the terminal, but in Console I get the following error:
Context
Please provide any relevant information about your setup.
Package Version:
Express Version:
Sequelize Version:
Database Dialect: postres
Database Version:
Project Name: Valhalla
NB. My database is correctly analysed (FA shows correct count for each table in the search box) and when a table is empty FA knows as much and offers to create a new record. I have tried running the project on both Windows and Linux, with the same results.
Trying to export the table gives the following error in the terminal:
[forest] ��� Unexpected error: column meetupgroupmembers.id does not exist
SequelizeDatabaseError: column meetupgroupmembers.id does not exist
at Query.formatError (C:\Users\guy\Downloads\Valhalla\node_modules\sequelize\lib\dialects\postgres\query.js:354:16)
at C:\Users\guy\Downloads\Valhalla\node_modules\sequelize\lib\dialects\postgres\query.js:71:18
at tryCatcher (C:\Users\guy\Downloads\Valhalla\node_modules\sequelize\node_modules\bluebird\js\release\util.js:16:23)
at Promise._settlePromiseFromHandler (C:\Users\guy\Downloads\Valhalla\node_modules\sequelize\node_modules\bluebird\js\release\promise.js:547:31)
at Promise._settlePromise (C:\Users\guy\Downloads\Valhalla\node_modules\sequelize\node_modules\bluebird\js\release\promise.js:604:18)
at Promise._settlePromise0 (C:\Users\guy\Downloads\Valhalla\node_modules\sequelize\node_modules\bluebird\js\release\promise.js:649:10)
at Promise._settlePromises (C:\Users\guy\Downloads\Valhalla\node_modules\sequelize\node_modules\bluebird\js\release\promise.js:725:18)
at _drainQueueStep (C:\Users\guy\Downloads\Valhalla\node_modules\sequelize\node_modules\bluebird\js\release\async.js:93:12)
at _drainQueue (C:\Users\guy\Downloads\Valhalla\node_modules\sequelize\node_modules\bluebird\js\release\async.js:86:9)
at Async._drainQueues (C:\Users\guy\Downloads\Valhalla\node_modules\sequelize\node_modules\bluebird\js\release\async.js:102:5)
at Immediate.Async.drainQueues [as _onImmediate] (C:\Users\guy\Downloads\Valhalla\node_modules\sequelize\node_modules\bluebird\js\release\async.js:15:14)
at processImmediate (internal/timers.js:456:21)
Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
at ServerResponse.setHeader (_http_outgoing.js:518:11)
at ServerResponse.header (C:\Users\guy\Downloads\Valhalla\node_modules\express\lib\response.js:767:10)
at ServerResponse.send (C:\Users\guy\Downloads\Valhalla\node_modules\express\lib\response.js:170:12)
at ServerResponse.json (C:\Users\guy\Downloads\Valhalla\node_modules\express\lib\response.js:267:15)
at ServerResponse.send (C:\Users\guy\Downloads\Valhalla\node_modules\express\lib\response.js:158:21)
at exports.catchIfAny (C:\Users\guy\Downloads\Valhalla\node_modules\forest-express\dist\services\error-handler.js:17:42)
at Layer.handle_error (C:\Users\guy\Downloads\Valhalla\node_modules\forest-express\node_modules\express\lib\router\layer.js:71:5)
at trim_prefix (C:\Users\guy\Downloads\Valhalla\node_modules\forest-express\node_modules\express\lib\router\index.js:315:13)
at C:\Users\guy\Downloads\Valhalla\node_modules\forest-express\node_modules\express\lib\router\index.js:284:7
at param (C:\Users\guy\Downloads\Valhalla\node_modules\forest-express\node_modules\express\lib\router\index.js:354:14)
at param (C:\Users\guy\Downloads\Valhalla\node_modules\forest-express\node_modules\express\lib\router\index.js:365:14)
at Function.process_params (C:\Users\guy\Downloads\Valhalla\node_modules\forest-express\node_modules\express\lib\router\index.js:410:3)
at next (C:\Users\guy\Downloads\Valhalla\node_modules\forest-express\node_modules\express\lib\router\index.js:275:10)
at next (C:\Users\guy\Downloads\Valhalla\node_modules\forest-express\node_modules\express\lib\router\route.js:127:14)
GET /forest/meetupgroupmembers.csv?fields%5Bmeetupgroupmembers%5D=facebookid%2Clastvisited&search=&filters=&searchExtended=0&timezone=Asia%2FJerusalem&filename=meetupgroupmembers&header=facebookid%2Clastvisited 500 - - 2.221 ms
I think yes, you need some kind of primary key (ID or composite PK) to use forestadmin, for a few simple reasons, the biggest one beeing that a specific record have a direct url to access it (That should obviously be unique in order to update/delete).
Let’s say I have a database Person(name) with 3 records without id, Joe, John and Joe. Deleting a “Joe” record would not have an expected behavior (Delete only one? delete 2?) since we would not be able to determine which one to delete.
Still, I did a quick test on my end to ensure that, and I’m getting a similar error. A simple way to fix this issue would be to generate a composite PK in your case (If you really don’t want any direct id in your database), since lumber is able to handle such cases.