teamtnt / laravel-scout-tntsearch-driver

Driver for Laravel Scout search package based on https://github.com/teamtnt/tntsearch
MIT License
1.09k stars 142 forks source link

[Enhancement]Replace getPdo with getReadPdo #346

Open maoxuner opened 1 year ago

maoxuner commented 1 year ago

https://github.com/teamtnt/laravel-scout-tntsearch-driver/blob/e48c84d29592c7b41d0dcfa6332b0212d8913b4f/src/Console/ImportCommand.php#L44

When importing, read only access is enough. I think it will be better to replace getPdo with getReadPdo if there is a read-and-write connection.

In my condition, I run tntsearch:import from a standalone instance with only read only access to my db. But getPdo always returns default pdo (from database write server config)