Only a non-null query is executed as part of an insert.
The basic structure for processing events.