Are there advantages or disadvantages to having your engine running while running a device (compressor, etc) directly from the battery?
A fully charged battery will give you around 12,8V, when the engine is running it will be most likely around 14,4V. Your device (if it is a compressor) may run "better"/"faster" with the slightly higher voltage.
If you run the engine you also do not risk discharging the battery too deep that would prevent you from starting the car again.
There disadvantage for running appliances from the car's starting battery.
Depleting the battery, and not being able to start the engine.
Others respondent have mentioned this already.
Shortening the life of the starter battery.
Starter batteries are designed to deliver high peak current, but they aren't designed for deep discharge. Deep discharge shortens the life of the starter batteries.
Depth of Discharge Starter Battery Deep-cycle Battery 100% 12–15 cycles 150–200 cycles 50% 100–120 cycles 400–500 cycles 30% 130–150 cycles 1,000 and more cycles
So, Keep the engine running.
Or, use a separate deep cycle lead-acid battery to run appliances.
Or, use a separate generator.
Advantage: pump won't drain your battery so you're able to drive away afterwards.
Disadvantage: burns gas, highly inefficient compared to an actual stand alone alternator.
Compressor will run better due to higher voltage and will run till you run out of gas and the battery dies. Engine off, battery will drain and you may not be able to start your vehicle.
Check if the device is specified to be connected to a running car. Besides the higher system voltage a running engine may cause voltage spikes, transients and other things which a device must be able to handle if it is (meant) to be connected to a running car's electrical system.
That's one of the (legal) reasons why some devices' instructions explicitly state that the engine must not be running when using them.