oetiker / rrdtool-1.x

RRDtool 1.x - Round Robin Database
http://www.rrdtool.org
GNU General Public License v2.0
1k stars 263 forks source link

Allow sql// and sql|| (pipe pipe) for libdbi datasources #421

Open crossett opened 10 years ago

crossett commented 10 years ago

Hi,

Could you update line 240 in rrd_fetch.c from

    if (strncmp("sql//",filename,5)==0) {

to

    if (strncmp("sql//",filename,5)==0 || strncmp("sql||",filename,5)==0) {

so that developers connecting to sqlite3 can connect to a database with at path other than '.'? It looks rrd_fetch_libdbi.c has already been setup to handle a separator other than '/' so I think it is just a one line update.

My connect string current looks like this:

    sql//sqlite3/sqlite3_dbdir=./dbname=logger.db/.....

I would like it to look like this:

    sql||sqlite3|sqlite3_dbdir=/home/user/db|dbname=logger.db|.....

Thanks, Jonathan

oetiker commented 10 years ago

I agree, what you propose should work ... will you send a pull request ?