nikclayton / ob-sql-mode

sql-mode backend for Org Babel
GNU General Public License v3.0
31 stars 10 forks source link

Auto set src block buffer sql-mode `sql-product` from header argument… #15

Open stardiviner opened 8 months ago

stardiviner commented 8 months ago

:product

Configure ob-sql-mode editing source block buffer with the header argument :product' specified database product corresponding sql-mode productsql-product'


This change is Reviewable

mplscorwin commented 8 months ago

Hi @stardiviner, thanks for the patch!

Is it possible to set a default :product for all source blocks? If so, is there anything to do here to make sure such a default is obeyed?

I look forward to trying this out.

stardiviner commented 8 months ago

@mplscorwin Org mode support babel language default arguments through this variable, like bellowing:

  ;; Specify default :product and :session.
  (add-to-list 'org-babel-default-header-args:sql-mode '(:product . "sqlite"))
  (add-to-list 'org-babel-default-header-args:sql-mode '(:session . "sqlite-test.db"))

Maybe use another variable:

(add-to-list 'org-babel-header-args:sql-mode '(:product . "sqlite"))
stardiviner commented 8 months ago

@mplscorwin Hi, any idea update about this patch?