Power menu (Shutdown, Reboot, Sleep) in ELISP
Disclaimer: Total beginner here too. So take everything with a grain of salt.
That being said this looks perfectly fine. However, I suggest you to use completing-read instead of ivy-completing-read as it will provide more flexibility. Don't worry, if you use ivy-mode (or customize completing-read-function to ivy-completing-read), then completing-read will use ivy-completing-read.This is especially helpful if you want to copy your snippet to another Emacs configuration where ivy isn't installed.
Other than that, I guess you want to introduce action before you setq it. However, I'm not really sure whether it's necessary.
Note that I will probably use your db/power-menu in my configuration. Well done :)