You don't have to connect the controller to the PS4 if its battery is low/zero. You can just connect it to any USB power source, while using it to play PS4 game at the same time. I have a 5m USB cable, just plug it in to any USB charger (1A type should be enough as it doesn't draw a lot of power).
If you want to connect to PS4 for charging, you can use a USB hub. I have a simple hub (just USB 2.0, not even 3.0) plugged into the PS4 all the time. I put USB thumb drive on it (to backup save file), bluetooth dongle (for using bluetooth headset with PS4 games), another audio dongle (for Sony PS Pluse Elite), PS4 controller (if I want to charge, though now I use a separate USB charger). My hub has button to toggle on/off for each port, so I can just turn on those that I want, but that's optional. I don't plug the external HDD into the hub though, I use a dedicated port on the PS4 for that.
And if you don't want to keep using the controller wired, just replace the battery. You can buy a battery from Aliexpress at US$8. Battery is the easiest thing to replace, as it's the first thing you see after unscrewing and opening the controller.