SQL implementation of file repository and tests