[x] Implement a force option in copy and move methods to overwrite the destination files if they exist.
[x] Without force option, do not copy the files and do not raise an error either (maybe log a warning).
[x] In case of an existing market catalogue file, extract the metadata again and update the database index entry (use SQL's UPDATE command: https://www.w3schools.com/sql/sql_update.asp). Compare the files to see if they are identical.
[x] In case of an existing market data file, check file sizes and only replace if the new file is larger than the first one. Sometimes a market close message gets emitted weeks after the market actually closed. Regarding the database, do nothing. All the metadata is extracted from the catalogue file, and if the file already exists, marketDataFilePath is correct regardless of the actual file it points to.
In
Market._change_location
,FileExistsError
is raised if the market catalogue or data file already exists at the destination: https://github.com/mzaja/betfair-database/blob/d153e47a32f289e479872564502262eb32d9de04/betfairdatabase/market.py#L179-L186force
option incopy
andmove
methods to overwrite the destination files if they exist.force
option, do not copy the files and do not raise an error either (maybe log a warning).UPDATE
command: https://www.w3schools.com/sql/sql_update.asp). Compare the files to see if they are identical.marketDataFilePath
is correct regardless of the actual file it points to.