unofficial mirror of emacs-orgmode@gnu.org
 help / color / Atom feed
* ob-sql src blocks with a totally custom engine
@ 2020-06-16 20:35 Ag Ibragimov
  2020-06-16 23:20 ` stardiviner
  0 siblings, 1 reply; 2+ messages in thread
From: Ag Ibragimov @ 2020-06-16 20:35 UTC (permalink / raw)
  To: emacs-orgmode

Is it possible to have source code SQL blocks that are processed with a custom command line tool?
e.g. how can I make something like this to work:

#+begin_src sql :cmdline "osqueryi --json"
  select * from processes limit 5;
#+end_src

For those who don't know what osquery is, here's a quote from https://osquery.io: "Osquery uses basic SQL commands to leverage a relational data-model to describe a device."

I vaguely remember there was a way to basically "pipe" entire code block to be executed in a given cmd line tool, but I am struggling to find how to do that. There's a way, right? But even then, I think it requires the code block to be of sh-mode of shell-mode, but I want it to be SQL because osquery uses SQL.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: ob-sql src blocks with a totally custom engine
  2020-06-16 20:35 ob-sql src blocks with a totally custom engine Ag Ibragimov
@ 2020-06-16 23:20 ` stardiviner
  0 siblings, 0 replies; 2+ messages in thread
From: stardiviner @ 2020-06-16 23:20 UTC (permalink / raw)
  To: Ag Ibragimov; +Cc: emacs-orgmode

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256


Ag Ibragimov <agzam.ibragimov@gmail.com> writes:

> Is it possible to have source code SQL blocks that are processed with a custom command line tool?
> e.g. how can I make something like this to work:
>
> #+begin_src sql :cmdline "osqueryi --json"
>  select * from processes limit 5;
> #+end_src

I think it's possible. Should not be hard to implement. You can check out ob-sql.el source code.

>
> For those who don't know what osquery is, here's a quote from https://osquery.io: "Osquery uses basic SQL commands to leverage a relational data-model to describe a device."

This is interesting project.

>
> I vaguely remember there was a way to basically "pipe" entire code block to be executed in a given cmd line tool, but I am struggling to find how to do that. There's a way, right? But even then, I think it requires the code block to be of sh-mode of shell-mode, but I want it to be SQL because osquery uses SQL.


- -- 
[ stardiviner ]
       I try to make every word tell the meaning that I want to express.

       Blog: https://stardiviner.github.io/
       IRC(freenode): stardiviner, Matrix: stardiviner
       GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
-----BEGIN PGP SIGNATURE-----

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7pU6gUHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsOTXQf/Z3CT2/mTjtCeaSGaZSzziO3TQVzO
k8eIu/6cX9byVIg96DOpiyWy6+u89C9YTT78w2vqPy353P6+XOskkBBGPLyHlPqa
PyePGNvOAGiFevT7CB0b2X6HuzhkL3bTJt7PQhkc/PakrN2Da7/MewC2UBNML5lQ
t27KEv3JKjQcY79LtcEr0vT0TxXAY1gluO2Flm/b7jXF4DnNBOTfItqGdmTDOxRE
t45jbbM/1SrpwsFvSTLQNI3WBklXDZNF3soiSoc+tw0g0Cn/MQqLKDN1ZE1zbGBf
T8exQ+TuXjQn3yMC8zAhwIluaoCTxyN3gJIIVtT6ZCKrEblcvQxL3aonjA==
=yK3s
-----END PGP SIGNATURE-----


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-16 20:35 ob-sql src blocks with a totally custom engine Ag Ibragimov
2020-06-16 23:20 ` stardiviner

unofficial mirror of emacs-orgmode@gnu.org

Archives are clonable:
	git clone --mirror https://yhetil.org/orgmode/0 orgmode/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 orgmode orgmode/ https://yhetil.org/orgmode \
		emacs-orgmode@gnu.org
	public-inbox-index orgmode

Example config snippet for mirrors

Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.emacs.orgmode
	nntp://news.gmane.io/gmane.emacs.orgmode


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git