examining database write function