Closed siamak2 closed 4 years ago
Hi I was reviewing executed queries in telescope and noticed there are duplicate queries like this:
select column_name as column_name from information_schema.columns where table_schema = 'db_name' and table_name = 'table_name'
column_name
so I traced the query and saw this: https://github.com/kodeine/laravel-meta/blob/052098ba5934729b717adb0ce941ad38f2889318/src/Kodeine/Metable/Metable.php#L429 which is called every time I try to set new attribute to the model and executes that query every time. so this PR will cache the query result and prevents executing same query multiple times.
Thank you
Hi I was reviewing executed queries in telescope and noticed there are duplicate queries like this:
so I traced the query and saw this: https://github.com/kodeine/laravel-meta/blob/052098ba5934729b717adb0ce941ad38f2889318/src/Kodeine/Metable/Metable.php#L429 which is called every time I try to set new attribute to the model and executes that query every time. so this PR will cache the query result and prevents executing same query multiple times.