Get All post that is in table

WordPress queries (using WP_Query or get_posts() either) support post__in argument to retrieve specific set of posts by IDs.

So you would need to produce such list from your custom storage and then use in a query.