Prevents SQL error caused by primary_key
not being set
Previously the SelectFromDatabase
strategy connects to the database, and extracts the values, when it's initalized. However, at this stage,the table
isn't fully configured and so when it creates the source table, it doesn't set a primary key.
By changing it to lazily fetch, and cache, the values; we ensure that the source table will be correctly configured.