How to test if Dataloader is working correctly, we are going to turn on server logging in order to see how many queries are being made to our db. If Dataloader is setup correctly, we should only see one hit on our db perrequest, even if duplicate data is being requested. Here's how to enable logging on postgresql. Note - This is the Mac way to enable logging.
-
subl /usr/local/var/postgres/postgresql.conf
-
around line 434
log_statement = 'all'
uncomment and set to alllog_statement = 'all'
-
then
brew service restart postgresql
-
To view your logs coming in run
tail -f /usr/local/var/postgres/server.log
-
Here is a sample graphiql query to test dataloader:
{ people { first_name spouse { fullName spouse { fullName spouse { fullName } } } } }
-
If Dataloader is setup correctly - you should only see one request being sent to your DB for multeiple calls.
As far as I see, the same
loaders
object is going to be reused between requests without ever cleaning it's cache. Would be good if it would use the cache per request only, and would do requests to DB for every request