|
From: Wesley M. <mo...@ch...> - 2004-05-18 01:54:54
|
On Mon, 17 May 2004, Ethan Merritt wrote: > On Monday 17 May 2004 05:54 pm, you wrote: > > > Something more or less like: > > > > > > gnuplot> ! mkfifo ./database_out > > > gnuplot> ! db 'select * from table' > ./database_out > > > gnuplot> plot '< ./database_out' with lines > > > > Yes, but isn't that much more complicated than simply gnuplot itself > > supporting a direct connection to the db? :> > > I don't know. > I still don't understand what you have in mind, maybe because > I'm not a database guy. > > Isn't every database going to have its own set of commands? That's what SQL is for :) > How is gnuplot ever going to know what to send other than just > passing through what you type? I used a fifo in my example to > show you that it can be done that way, but for the simple case > at hand you can do it all in a single command anyhow: > > plot "< db 'select * from table'" with lines > > or whatever the database command might be. What syntax did > you have in mind that would be simpler? The thing is that databases like mysql and postgres, the two most used OSS servers, don't output useable data by default (it's "pretty print"), so you would have to learn the somewhat cumbersome and irritating syntax to fix this (although you could write another passthrough shell command for it). Some databases may not even have a command-line client. If gnuplot had support for several different backends, you could plot data from any of them with ease, not needing to worry about differences in arguments etc. Just simple SQL. Anyhow.. Is there any kind of documentation on the gnuplot internals, or am I better off reading the source? -- Hi! I'm a .signature virus! Copy me into your ~/.signature to help me spread! |