Database direct access in Strapi 5

I wonder what is the correct way of accessing the database directly in Strapi 5.

In Strapi 4, there’s docs on accessing knex via strapi.db.connection. However, in Strapi 5 I haven’t found any docs on this API.

I know it exists in Strapi 5 but my question is: whether it’s legitimate to use this API in Strapi 5 or whether it’s planned to be removed?

And if so, how do I directly access the database with Strapi 5?