Thanks for the post! Whether you have access to your TestRail database would depend on the version of TestRail you use. With TestRail Server, you would host your database on your own server and have access to its contents. With TestRail Cloud, however, you would not have access to the database to perform any direct queries, as it would be stored on our secured servers.
With either version, we would recommend you use the API anyway, as we specifically designed the API so you can retrieve data in an effective and safe manner. You can review our API documentation here:
Please note that with TestRail Server, you should never directly write to or change anything in TestRail’s database. This would break the consistency of the database, even small changes you might find unproblematic, and we would not be able to offer support for a database which has been altered.