add derived file: escape file name for sqlite and free prepared statement resources earlier