[sqlite] mmap on FreeBSD/DragonFly

2015-07-16 Thread Baptiste Daroussin
Hi,

I have been testing sqlite mmap on FreeBSD/DragonFly and it works
perfectly well. (the package manager uses sqlite this is where I have
been testing it)

would it be possible to activate it?
https://people.freebsd.org/~bapt/freebsd-dragonfly-mmap.diff

Best regards,
Bapt


Re: [sqlite] pragma and prepare statement

2014-07-15 Thread Baptiste Daroussin
The second point seems to explain my problems thanks you

2014-07-10 18:05 GMT+02:00 Dan Kennedy :
> On 07/10/2014 08:44 PM, Baptiste Daroussin wrote:
>>
>> Hi,
>>
>> We are using sqlite intensively in out developement and we discovered
>> that apparently we cannot create a statement with a pragma
>>
>> Is there a reason why it is not possible? is it a bug or a per design
>
>
> The docs feature the following two points:
>
> * No error messages are generated if an unknown pragma is issued. Unknown
> pragmas are simply ignored. This means if there is a typo in a pragma
> statement the library does not inform the user of the fact.
>
> * Some pragmas take effect during the SQL compilation stage, not the
> execution stage. This means if using the C-language sqlite3_prepare()
> <https://www.sqlite.org/c3ref/prepare.html>, sqlite3_step()
> <https://www.sqlite.org/c3ref/step.html>, sqlite3_finalize()
> <https://www.sqlite.org/c3ref/finalize.html> API (or similar in a wrapper
> interface), the pragma may run during the sqlite3_prepare()
> <https://www.sqlite.org/c3ref/prepare.html> call, not during the
> sqlite3_step() <https://www.sqlite.org/c3ref/step.html> call as normal SQL
> statements do. Or the pragma might run during sqlite3_step() just like
> normal SQL statements. Whether or not the pragma runs during
> sqlite3_prepare() or sqlite3_step() depends on the pragma and on the
> specific release of SQLite.
>
> Do either of them explain what you are seeing?
>
>   https://www.sqlite.org/pragma.html
>
> Dan.
>
>
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] pragma and prepare statement

2014-07-10 Thread Baptiste Daroussin
Hi,

We are using sqlite intensively in out developement and we discovered
that apparently we cannot create a statement with a pragma

Is there a reason why it is not possible? is it a bug or a per design

regards,
Bapt
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] FreeBSD and SQLITE_ENABLE_LOCKING_STYLE

2013-04-11 Thread Baptiste Daroussin
That seems to work thank you, this is quite odd to me given nfsv4 is
supposed to handle the locks natively. Anyway thank you, I'll create a
patch to activate unix-dotfile by default on network filesystems.

regards,
Bapt


2013/4/11 Richard Hipp 

> On Thu, Apr 11, 2013 at 4:03 AM, Baptiste Daroussin <
> baptiste.darous...@gmail.com> wrote:
>
> > Ok so I was not going in the right direction :)
> >
> > So how it is possible to corrupt a database on nfsv4? Does that ring a
> bell
> > to someone?
> >
> >
> Probably the posix advisory locks are not working.  Have you tried running
> using the "unix-dotfile" VFS?
>
>
>
> >
> >
> >
> > 2013/4/11 Richard Hipp 
> >
> > > On Wed, Apr 10, 2013 at 6:40 PM, Baptiste Daroussin <
> > > baptiste.darous...@gmail.com> wrote:
> > >
> > > > I'm trying to activate SQLITE_ENABLE_LOCKING_STYLE=1 on FreeBSD.
> > > >
> > >
> > > The SQLITE_ENABLE_LOCKING_STYLE compile-time option is code that was
> > > contributed and supported by Apple specifically for use on Mac OS-X.
> > > Unfortunately, the engineer at Apple who was providing that support has
> > > moved on and so the SQLITE_ENABLE_LOCKING_STYLE compile-time option has
> > > been orphaned.  It is currently unsupported and untested.
> > >
> > > Note that the SQLite core team contains to support, maintain, and test
> > > SQLite on OS-X.  We just don't provide support for the
> > > SQLITE_ENABLE_LOCKING_STYLE compile-time option.
> > >
> > > --
> > > D. Richard Hipp
> > > d...@sqlite.org
> > > ___
> > > sqlite-users mailing list
> > > sqlite-users@sqlite.org
> > > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> > >
> > ___
> > sqlite-users mailing list
> > sqlite-users@sqlite.org
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >
>
>
>
> --
> D. Richard Hipp
> d...@sqlite.org
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] FreeBSD and SQLITE_ENABLE_LOCKING_STYLE

2013-04-11 Thread Baptiste Daroussin
Ok so I was not going in the right direction :)

So how it is possible to corrupt a database on nfsv4? Does that ring a bell
to someone?




2013/4/11 Richard Hipp 

> On Wed, Apr 10, 2013 at 6:40 PM, Baptiste Daroussin <
> baptiste.darous...@gmail.com> wrote:
>
> > I'm trying to activate SQLITE_ENABLE_LOCKING_STYLE=1 on FreeBSD.
> >
>
> The SQLITE_ENABLE_LOCKING_STYLE compile-time option is code that was
> contributed and supported by Apple specifically for use on Mac OS-X.
> Unfortunately, the engineer at Apple who was providing that support has
> moved on and so the SQLITE_ENABLE_LOCKING_STYLE compile-time option has
> been orphaned.  It is currently unsupported and untested.
>
> Note that the SQLite core team contains to support, maintain, and test
> SQLite on OS-X.  We just don't provide support for the
> SQLITE_ENABLE_LOCKING_STYLE compile-time option.
>
> --
> D. Richard Hipp
> d...@sqlite.org
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] FreeBSD and SQLITE_ENABLE_LOCKING_STYLE

2013-04-10 Thread Baptiste Daroussin
I'm trying to activate SQLITE_ENABLE_LOCKING_STYLE=1 on FreeBSD.

We use SQLite for our new package manager and we get a report from a user
about a totally corrupted database when on nfsv4.

I want to try activating this option, but received a compilation failure
sqlite3.c:28290:14: error: implicit declaration of function
'proxyTransformUnixFile' is invalid in C99
[-Werror,-Wimplicit-function-declaration]
rc = proxyTransformUnixFile((unixFile*)pFile, ":auto:");
 ^


Why does the proxyTranformUnixFile function is defined surrounded by the
following tests:

#if SQLITE_ENABLE_LOCKING_STYLE && defined(__Apple__)
...
#endif

Given that this will be called later in a block that only checks
SQLITE_ENABLE_LOCKING_STYLE

?

This is on sqlite 3.7.16.1

regards,
Bapt
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] feed "endless" data into sqlite, thru a shell script

2011-09-26 Thread Baptiste Daroussin
2011/9/27 Patrick Proniewski :
> Hello,
>
> I'm facing a challenging problem. I want to log some data into an SQLite3 DB. 
> Data come from a system command (iostat) in an endless steam, one row every X 
> seconds:
>
>         disk0
>   KB/t tps  MB/s
>   4.02 2318 9.09
>   4.00 1237  4.83
>   6.63 979  6.34
>  46.30  15  0.69
>  30.58  23  0.69
>  12.90  32  0.41
>  107.85  55  5.75
>
> I though I could easily pipe data into SQLite:
>
> iostat -d -w 10 disk0 |\
> awk '!/[a-zA-Z]/ {print "INSERT INTO io 
> VALUES(datetime(\"now\",\"localtime\"),"$1","$2","$3");"}' |\
> sqlite3 iostat.db
>
> but it won't work, because sqlite3 won't record any data until the iostat 
> command ends. And of course, this iostat command will never end.
> So I'm stuck with a working but very ugly script:
>
> while true; do
>  iostat -c 2 -d -w 10 disk0 |\
>  tail -1 |\
>  awk '!/[a-zA-Z]/ {print "INSERT INTO io 
> VALUES(datetime(\"now\",\"localtime\"),"$1","$2","$3");"}' |\
>  sqlite3 iostat.db
> done
>
> endless loop, forking iostat for 2 rows of data (-c 2), keeping only the last 
> row because the first one is an artifact (tail -1).
> I've tried various solutions with named pipes, file descriptors redirections… 
> but none worked, because they all seem to require the data steam to end 
> before feeding data into the DB.
>
> Any idea?
>
> regards,
> patpro
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>

You don't need awk :)


iostat -d -w 10 disk0 | while read a b c; do case $a in *[a-zA-Z]*)
continue ;; *) sqlite3 iostat.db "INSERT INTO io
VALUES(datetime('now', 'localtime'), \"$a\", \"$b\", \"$c\");" ;;
esac; done

(the mail can have beed splitted, but the above code should be one
single line :)

regards,
Bapt
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users