[sqlite] User-defined SQL functions

2016-02-21 Thread Olivier Mascia
Regards, Olivier Mascia, integral.be/om -- next part -- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 842 bytes Desc: Message signed with OpenPGP using GPGMail URL: <http://mailinglists.sqlite.org/cgi-bin/mailman/p

[sqlite] FTS4 inquiry (non-printable characters, column delimiters)

2016-02-21 Thread Ephraim Stevens
Greetings All, I use the Full Text Search facilities extensively. The feature is intuitive and works beautifully and super fast even with 100GB+ databases. I must applaud the SQLITE dev team on such amazing work. I have two questions with regards to FTS. 1) I'm going out on a limb here: As some

[sqlite] User-defined SQL functions

2016-02-21 Thread Olivier Mascia
-- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 842 bytes Desc: Message signed with OpenPGP using GPGMail URL: <http://mailinglists.sqlite.org/cgi-bin/mailman/private/sqlite-users/attachments/20160221/4d9028de/attachment.pgp>

[sqlite] Select top 1 from duplicate values

2016-02-21 Thread Keith Medcalf
select f1, (select max(f2) from mytable where f1 = o.f1 and (f3 & 8)) as f2 from mytable as o where (f3 & 8) group by f1; > -Original Message- > From: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users- > bounces

[sqlite] User-defined SQL functions

2016-02-21 Thread Richard Hipp
On 2/21/16, Olivier Mascia wrote: > > The way I had read that documentation is: if your function is meant to be > deterministic, returning the same result for the very same input, at least > for the duration of the SQL statement (or of course always), then you should > tag it as SQLITE_DETERMINIST

[sqlite] User-defined SQL functions

2016-02-21 Thread Stephan Beal
On Sun, Feb 21, 2016 at 6:09 PM, Olivier Mascia wrote: > Dear all, > > Is it possible to implement a SQL function ( > https://www.sqlite.org/c3ref/create_function.html), which implementation > would be able to return the same value for the duration of the current > transaction? > This _might_ su

[sqlite] User-defined SQL functions

2016-02-21 Thread Olivier Mascia
A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 842 bytes Desc: Message signed with OpenPGP using GPGMail URL: <http://mailinglists.sqlite.org/cgi-bin/mailman/private/sqlite-users/attachments/20160221/bc1a4da2/attachment.pgp>

[sqlite] Question about BerkeleyDB "SQLited"

2016-02-21 Thread javaj1...@elxala.com
Hi, Oracle is distributing its BerkeleyDB including an interesting fusion with SQLite where they take all from SQLite except the final storage engine b-tree and pager included. As a product it is possible to obtain a dbsql binary that is a clone of sqlite3 command line but working with BDB data

[sqlite] User-defined SQL functions

2016-02-21 Thread Keith Medcalf
Of course it is. The function merely needs to store a value associated with a connection if the value does not exist (for that connection) when it is called and use a commit_hook and rollback_hook so that it knows when it needs to clear the value for the connection. Then for every call on a c

[sqlite] User-defined SQL functions

2016-02-21 Thread Igor Tandetnik
On 2/21/2016 12:09 PM, Olivier Mascia wrote: > Is it possible to implement a SQL function > (https://www.sqlite.org/c3ref/create_function.html), which implementation > would be able to return the same value for the duration of the current > transaction? > > In other words, assume I'd like to imp

[sqlite] SQLite I/O tuning redux

2016-02-21 Thread R Smith
On 2016/02/21 1:49 AM, Richard Hipp wrote: > On 2/20/16, Dave Baggett wrote: >> Question: can I force SQLite to keep an index purely in memory, > No. Because if you did, other processes updating the table would have > no way of also updating the index. > Of course - but how about being able to

[sqlite] Question about BerkeleyDB "SQLited"

2016-02-21 Thread Charles Leifer
My "dbsql" is reporting version 3.8.3.1: ./dbsql --version 3.8.3.1 2014-02-11 14:52:19 ea3317a4803d71d88183b29f1d3086f46d68a00e I grabbed the berkeleydb code from Oracle's website, then compiled it with SQL compatibility. On Sun, Feb 21, 2016 at 9:37 AM, javaj1811 at elxala.com wrote: > Hi, >

[sqlite] Get count of unique values?

2016-02-21 Thread Michael Falconer
Both Igor's and Simon's solutions work on my test system. The only additional comment is that Simon's works in Sqlite as expected. However running the same on PostgreSQL bombs with an error complaining about an sub-query with no name! Interesting? Perhaps watch out for portability with that one. I

[sqlite] FTS design document

2016-02-21 Thread Charles Leifer
Is anyone aware of a design doc for any of the FTS implementations? Looking for something a bit more technical than the docs. If not, where in the source would you recommend starting? Thanks!