Thanks for the feedback. Please never change anything directly in TestRail’s database as even very small changes would directly result in an inconsistent database and unsupported TestRail installation. If you already made changes to the database, please revert any changes by rolling back to a previous database backup.
TestRail’s API currently doesn’t support uploading attachments, but this is already on our to-do list and we plan to look into supporting this soon. That said, you can still already use files with test results/test cases you create via the API via a workaround in the meantime. You can simply upload the files to a separate web server or shared space your team might already be using (or even the same web server as TestRail if you host TestRail yourself) and then simply link to the files from your test results or test cases you add via the API.
TestRail also supports Markdown formatting so you can even format the links to your files so this would work similar to directly uploading files via the API. We do plan to look into support file attachments via the API directly as well though.