SQL execution completion notifications

Often I have SQLPro running in the background and I find I flick back and forth to see if an SQL has completed, or have it partially visible to monitor it. What would be nice is if:

  1. That we have an option to get OS Notifications upon SQL completion when the SQLPro App is not the frontmost window
  2. That we have the option to turn on badge notifications (the red number on the icon in the dock). The number will increment when each SQL execution completes whilst the app is not frontmost, and when you switch the application to frontmost the badge notifications clear.
  3. That we have the option for the icon to bounce in the dock each time an SQL completes whilst the app is not frontmost 
3replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • Example swift code of what I am getting at if it helps

    //

    //  ViewController.swift

    //

     

    import Cocoa

     

    class ViewController: NSViewController {

        var timer = Timer()

        var i: Int = 0;

        var notify: Bool = true

        var badge: Bool = true

        var bounce: Bool = true

     

        override func viewDidLoad() {

            super.viewDidLoad()

            timer = Timer.scheduledTimer(timeInterval: 3, target: self, selector: #selector(self.updateCounting), userInfo: nil, repeats: true)

        }

     

        override var representedObject: Any? {

            didSet {

            }

        }

        @objc func updateCounting() {

            i = i + 1

            if( NSWorkspace.shared.frontmostApplication?.bundleIdentifier == Bundle.main.bundleIdentifier ) {

                i = 0;

            }

            if(i == 0) {

                NSApp.dockTile.badgeLabel = ""

            } else {

                if(notify) {

                    let notification = NSUserNotification()

                    notification.title = Bundle.main.bundleIdentifier

                    notification.informativeText = "Finished query \(i)"

                    NSUserNotificationCenter.default.deliver(notification)

                }

                if(badge) { NSApp.dockTile.badgeLabel = "\(i)" }

                if(bounce) { NSApp.requestUserAttention(.informationalRequest) }

            }

        }

     

    }

    Like
  • FYI, I added this to all of the latest builds. If SQLPro is in the background when a query completes, the icon should now bounce. At the moment, I don't plan on adding badge counts.

    Like
    • Kyle Hankinson thank you vey much, I think I already have it on Version 1.0.429 (Build 110429), I love it !

       

      FYI it would still be nice to have a badge, even if not a count but just a flag, as sometimes I can often miss the bounce due to being focussed on my second  screen or away from my computer and it is nice to know that I have completed queries.

      Like
Like Follow
  • 10 mths agoLast active
  • 3Replies
  • 33Views
  • 2 Following