Error "Selecting deleted buffer" latest emacs build

I compiled the latest Emacs 30 from main and got below error when Emacs starts up.
After some searching recompiled sqlitedb to no avail. Any ideas?

Debugger entered--Lisp error: (error "Selecting deleted buffer")
  #f(compiled-function (connection) "Return true if the end of the buffer has a properly-formatted prompt." #<bytecode 0x1f119f66cd5a7127>)(#<emacsql-sqlite-connection emacsql-sqlite-connection-158efb93c090>)
  apply(#f(compiled-function (connection) "Return true if the end of the buffer has a properly-formatted prompt." #<bytecode 0x1f119f66cd5a7127>) #<emacsql-sqlite-connection emacsql-sqlite-connection-158efb93c090> nil)
  emacsql-waiting-p(#<emacsql-sqlite-connection emacsql-sqlite-connection-158efb93c090>)
  #f(compiled-function (connection &optional timeout) "Block until CONNECTION is waiting for further input." #<bytecode 0x1be680c649257bcc>)(#<emacsql-sqlite-connection emacsql-sqlite-connection-158efb93c090>)
  apply(#f(compiled-function (connection &optional timeout) "Block until CONNECTION is waiting for further input." #<bytecode 0x1be680c649257bcc>) #<emacsql-sqlite-connection emacsql-sqlite-connection-158efb93c090> nil)
  emacsql-wait(#<emacsql-sqlite-connection emacsql-sqlite-connection-158efb93c090>)
  #f(compiled-function (connection sql &rest args) #<bytecode -0x98c0e448cf60464>)(#<emacsql-sqlite-connection emacsql-sqlite-connection-158efb93c090> [:pragma (= busy-timeout $s1)] 15000)
  apply(#f(compiled-function (connection sql &rest args) #<bytecode -0x98c0e448cf60464>) #<emacsql-sqlite-connection emacsql-sqlite-connection-158efb93c090> ([:pragma (= busy-timeout $s1)] 15000))
  emacsql(#<emacsql-sqlite-connection emacsql-sqlite-connection-158efb93c090> [:pragma (= busy-timeout $s1)] 15000)
  #f(compiled-function (connection &rest rest) #<bytecode 0x8aaf9eb786f5542>)(#<emacsql-sqlite-connection emacsql-sqlite-connection-158efb93c090> (:file "~/.config/emacs/ae/org-roam.db"))
  apply(#f(compiled-function (connection &rest rest) #<bytecode 0x8aaf9eb786f5542>) (#<emacsql-sqlite-connection emacsql-sqlite-connection-158efb93c090> (:file "~/.config/emacs/ae/org-roam.db")))
  #f(compiled-function (&rest args) #<bytecode 0x1d0de56ae1e91d21>)(#<emacsql-sqlite-connection emacsql-sqlite-connection-158efb93c090> (:file "~/.config/emacs/ae/org-roam.db"))
  apply(#f(compiled-function (&rest args) #<bytecode 0x1d0de56ae1e91d21>) #<emacsql-sqlite-connection emacsql-sqlite-connection-158efb93c090> (:file "~/.config/emacs/ae/org-roam.db"))
  initialize-instance(#<emacsql-sqlite-connection emacsql-sqlite-connection-158efb93c090> (:file "~/.config/emacs/ae/org-roam.db"))
  #f(compiled-function (class &rest slots) "Default constructor for CLASS `eieio-default-superclass'.\nSLOTS are the initialization slots used by `initialize-instance'.\nThis static method is called when an object is constructed.\nIt allocates the vector used to represent an EIEIO object, and then\ncalls `initialize-instance' on that object." #<bytecode 0x4452e5f3afa779e>)(emacsql-sqlite-connection :file "~/.config/emacs/ae/org-roam.db")
  apply(#f(compiled-function (class &rest slots) "Default constructor for CLASS `eieio-default-superclass'.\nSLOTS are the initialization slots used by `initialize-instance'.\nThis static method is called when an object is constructed.\nIt allocates the vector used to represent an EIEIO object, and then\ncalls `initialize-instance' on that object." #<bytecode 0x4452e5f3afa779e>) emacsql-sqlite-connection (:file "~/.config/emacs/ae/org-roam.db"))
  make-instance(emacsql-sqlite-connection :file "~/.config/emacs/ae/org-roam.db")
  emacsql-sqlite("~/.config/emacs/ae/org-roam.db")
  org-roam-db()
  org-roam-db-sync()
  org-roam-db-autosync-mode(1)
  org-roam-setup()

emacsql package needed to be updated, see here.

Latest commit solved the issue: