C API reference manpages

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
41 messages Options
123
Reply | Threaded
Open this post in threaded view
|

C API reference manpages

Kristaps Dzonsons
Hello,

I couldn't find any way to convert the SQLite docs (via sqlite.h) to
UNIX manpages, so I wrote a tool that does so:

 https://github.com/kristapsdz/sqlite2mdoc

This generates one manpage per API reference with the proper SEE ALSO
(from collected references) and IMPLEMENTATION NOTES (the raw
declarations and preprocessor statements).  Its deficiencies are in
handling HTML tables (prints verbatim--not bad except for sqlite3_open,
where the table is quite wide), the mdoc(7) isn't picture-perfect, and
in handling some un-closed markup seen here and there.

It follows the logic of the Tcl code in capi3ref[2], but does so in C
w/o dependencies unless running Linux.

Is there any interest in integrating this tool to have manpages in the
doc distribution without downstream bits?

I've been using this for a while as part of the manpage corpus on my
OpenBSD, Mac OS X, and Linux machines.

Best,

Kristaps

[1] http://man.openbsd.org/OpenBSD-current/man7/mdoc.7
[2] https://www.sqlite.org/cgi/docsrc/finfo?name=pages/capi3ref.in
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: C API reference manpages

Richard Hipp-3
On 3/31/16, Kristaps Dzonsons <[hidden email]> wrote:
>
> Is there any interest in integrating this tool to have manpages in the
> doc distribution without downstream bits?
>

I think that would be cool.  Integrating your tool into the source
tree would mean that as the comment formats evolve, your tool would
evolve in lock-step.  If your tool is kept separate, then we might
change the documentation comment format without telling you, and break
things.

One issue is the license.  SQLite is public domain, not BSD (or ISC).
Is it even possible for citizens of Latvia to release something to the
public domain?  In any event, some paperwork would have to flow
between us to make that happen.  Though, maybe that is not a huge
concern as we are not nearly as persnickety with licensing for the
documentation as we are with the code, and this tool would go in the
separate documentation repository
(https://www.sqlite.org/docsrc/timeline), not in the main code
repository.

Would an even better solution be to enhance the capi3ref TCL script to
spit out mdoc files in parallel to the HTML documentation it currently
produces?

--
D. Richard Hipp
[hidden email]
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: C API reference manpages

Kristaps Dzonsons
>> Is there any interest in integrating this tool to have manpages in the

>> doc distribution without downstream bits?
>
> I think that would be cool.  Integrating your tool into the source
> tree would mean that as the comment formats evolve, your tool would
> evolve in lock-step.  If your tool is kept separate, then we might
> change the documentation comment format without telling you, and break
> things.
>
> One issue is the license.  SQLite is public domain, not BSD (or ISC).
> Is it even possible for citizens of Latvia to release something to the
> public domain?  In any event, some paperwork would have to flow
> between us to make that happen.  Though, maybe that is not a huge
> concern as we are not nearly as persnickety with licensing for the
> documentation as we are with the code, and this tool would go in the
> separate documentation repository
> (https://www.sqlite.org/docsrc/timeline), not in the main code
> repository.
>
> Would an even better solution be to enhance the capi3ref TCL script to
> spit out mdoc files in parallel to the HTML documentation it currently
> produces?
Richard,

As for public domain, I'm happy to put the sources under a similar
license.  I can't speak for the voodoo of the public domain and the EU
(or is it country-by-country?), however.

As for Tcl--I don't grok it myself or I'd have started modifying there.
 (I used capi3ref as a starting point.)  Be it C or Tcl, there's a lot
of string fiddling to get everything formatted for mdoc(7) (and to
collect refs), so it won't be pretty (or brief) in any language.

I'm happy maintaining the tool in or out of the tree--whatever's most
convenient.  I figured I'd just track changes to sqlite.h.in and update
the scanner if it was required.  (E.g. and in the most likely case: more
HTML tags.)  At the end of the day, I just want to use apropos and man
instead of the browser!

Best,

Kristaps


_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

signature.asc (859 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: C API reference manpages

Matthias-Christian Ott
On 31/03/16 14:39, Kristaps Dzonsons wrote:

>>> Is there any interest in integrating this tool to have manpages in the
>>> doc distribution without downstream bits?
>>
>> I think that would be cool.  Integrating your tool into the source
>> tree would mean that as the comment formats evolve, your tool would
>> evolve in lock-step.  If your tool is kept separate, then we might
>> change the documentation comment format without telling you, and break
>> things.
>>
>> One issue is the license.  SQLite is public domain, not BSD (or ISC).
>> Is it even possible for citizens of Latvia to release something to the
>> public domain?  In any event, some paperwork would have to flow
>> between us to make that happen.  Though, maybe that is not a huge
>> concern as we are not nearly as persnickety with licensing for the
>> documentation as we are with the code, and this tool would go in the
>> separate documentation repository
>> (https://www.sqlite.org/docsrc/timeline), not in the main code
>> repository.
>>
>> Would an even better solution be to enhance the capi3ref TCL script to
>> spit out mdoc files in parallel to the HTML documentation it currently
>> produces?
>
> Richard,
>
> As for public domain, I'm happy to put the sources under a similar
> license.  I can't speak for the voodoo of the public domain and the EU
> (or is it country-by-country?), however.

From an English translation I found of the Latvian law includes moral
rights and is closer to the droit d'auteur than copyright. So it seems
difficult to place your work in the public domain.

I would advise you to contact the FSF, FSFE Legal or SFLC in this matter
if you want a general advice without legal fees. This entire topic as
been discussed in context of Wikimedia's projects, especially Wikipedia
and Wikimedia Commons, and CC0, so you might find information about
Latvia there.

- Matthias-Christian
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: C API reference manpages

Kristaps Dzonsons
>> As for public domain, I'm happy to put the sources under a similar
>> license.  I can't speak for the voodoo of the public domain and the EU
>> (or is it country-by-country?), however.
>
> From an English translation I found of the Latvian law includes moral
> rights and is closer to the droit d'auteur than copyright. So it seems
> difficult to place your work in the public domain.
>
> I would advise you to contact the FSF, FSFE Legal or SFLC in this matter
> if you want a general advice without legal fees. This entire topic as
> been discussed in context of Wikimedia's projects, especially Wikipedia
> and Wikimedia Commons, and CC0, so you might find information about
> Latvia there.

Matthias-Christian,

I'm afraid I can't say anything useful about licenses, but in searching
around, it appears that you're correct[1].

Assuming, arguendo, that this is true, I'm happy to continue keeping the
source where it is and tracking the header file--something I'd need to
do anyway, of course, regardless of where it sits.  Or if, as Richard
intimated, an ISC licensed file is acceptable in docsrc, it may be kept
there.  I'm open to suggestions!

Regarding the system itself, are there any desired features or
invocations that I can implement for ease of use and/or utility?  It
emits pretty standard mdoc(7) markup except for the IMPLEMENTATION
NOTES, which is non-canonical (but documented), where I stash the actual
declarations themselves.  In short, the manpages have everything in them
that I would need as a user.

Best,

Kristaps

[1] http://www.satori.lv/raksts/4336/Autortiesibasunbriva_kultura
(Link contents in Latvian.)
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: C API reference manpages

James K. Lowden
In reply to this post by Richard Hipp-3
On Thu, 31 Mar 2016 10:21:53 -0400
Richard Hipp <[hidden email]> wrote:

> On 3/31/16, Kristaps Dzonsons <[hidden email]> wrote:
> >
> > Is there any interest in integrating this tool to have manpages in
> > the doc distribution without downstream bits?
> >
>
> I think that would be cool.  Integrating your tool into the source
> tree would mean that as the comment formats evolve, your tool would
> evolve in lock-step.  

+1.  I'm another who's wanted SQLite man pages for a long time.  I hope
you can see your way to integrating Kristaps's tool.  

--jkl

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

FTS5 problem ? more than 3,000 queries !

Domingo Alvarez Duarte-2
Hello !  

I'm testing fts5 on a database with data from hacker news (around 13M
records) and it took more than 2 hours to index, I have this application to
log all queries executed for debugging and although the search isn't slow
it's making a lot of queries.  

Is this normal ? More than 3,000 queries ?  

Cheers !  

   

CREATE TABLE "items" (
    'id' integer PRIMARY KEY,
    'parent' INTEGER,
    'by' text COLLATE NOCASE,
    'score' integer DEFAULT 0,
    'title' text  COLLATE NOCASE,
    'type' text  COLLATE NOCASE,
    'url' text  COLLATE NOCASE,
    'deleted' BOOLEAN DEFAULT 0,
    'dead' BOOLEAN DEFAULT 0,
    'comment' TEXT COLLATE NOCASE,
    'time' integer NOT NULL,
    descendants integer default 0
);  

CREATE VIRTUAL TABLE fts_idx_items USING fts5(title, comment, content=items,
content_rowid=id, prefix=3);  


The query:  

SQL    :  SELECT     a.id, a.parent, a.by, a.score,
                snippet(fts_idx_items, 0, '<em>', '</em>', '...',
12) as title,
                a.type, a.url,
                --snippet(fts_idx_items, 1, '<em>', '</em>',
'...', 12) as comment,
                a.descendants,
                datetime(a."time", 'unixepoch') AS time,
                (julianday('now') - julianday(datetime(a."time",
'unixepoch'))) as elapsed_time
            FROM items a, fts_idx_items b
            where fts_idx_items match 'title:sql'
            and a.id = b.rowid
            --and a.type != 'comment'
            ORDER BY rank --bm25(fts_idx_items)
            LIMIT 30 OFFSET 0  

Generates:  

SQL    :    -- SELECT rowid, rank FROM 'main'.'fts_idx_items' ORDER BY
bm25(fts_idx_items) ASC   

Followed by 28 of this:

SQL    :    -- SELECT pgno FROM 'main'.'fts_idx_items_idx' WHERE
segid=? AND term<=? ORDER BY term DESC LIMIT 1  

Followed by around 3,000 of:  

SQL    :    -- SELECT sz FROM 'main'.'fts_idx_items_docsize' WHERE id=?
 

Followed by 18 of:  

SQL    :    -- SELECT T.'id', T.'title', T.'comment' FROM
'main'.'items' T WHERE T.'id'=?   

SQL    :    -- SELECT sz FROM 'main'.'fts_idx_items_docsize' WHERE
id=?   

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: FTS5 problem ? more than 3,000 queries !

Simon Slavin-3

On 3 Apr 2016, at 11:43pm, Domingo Alvarez Duarte <[hidden email]> wrote:
>
> Is this normal ? More than 3,000 queries ?  

It looks to me as if your SELECT is returning 3000 results.  If you do a search for a rarer term does it execute fewer queries ?  For instance you might search for '<strong>' instead of '<em>'.

Simon.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Difference between sqlite3 executable and application

Domingo Alvarez Duarte-2
In reply to this post by Domingo Alvarez Duarte-2
Hello !  

I have an application that uses sqlite3 and in one database I get different
responses between the sqlite3 executable and my application that uses the
same sqlite3.c:  

The query:  

explain query plan select * from companies where post_code like 'rg%';  

My application:  

0    0    0    SCAN TABLE companies  

sqlite3 executable:  

0|0|0|SEARCH TABLE companies USING INDEX companies_post_code_idx (post_code>?
AND post_code<?)  

What compile time options if any can cause this ?  

Cheers !  

 

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Difference between sqlite3 executable and application

Simon Slavin-3

On 4 Apr 2016, at 9:53am, Domingo Alvarez Duarte <[hidden email]> wrote:

> What compile time options if any can cause this ?

I recommend you compare the results of

PRAGMA compile_options;

on the two platforms.

Simon.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: FTS5 problem ? more than 3,000 queries !

Dan Kennedy-4
In reply to this post by Domingo Alvarez Duarte-2
On 04/04/2016 05:43 AM, Domingo Alvarez Duarte wrote:
> Hello !
>
> I'm testing fts5 on a database with data from hacker news (around 13M
> records) and it took more than 2 hours to index, I have this application to
> log all queries executed for debugging and although the search isn't slow
> it's making a lot of queries.
>
> Is this normal ? More than 3,000 queries ?

Probably. Your query does "ORDER BY rank" with "rank" set to the built
in bm25() function. One of the things bm25() needs is the size of each
document that it is ranking. And obtaining this requires a separate
query on the %_sz table for each row. So if the MATCH expression matches
3000 rows, FTS5 makes 3000 SQL queries to obtain the size data.

Dan.





>
> Cheers !
>
>    
>
> CREATE TABLE "items" (
>      'id' integer PRIMARY KEY,
>      'parent' INTEGER,
>      'by' text COLLATE NOCASE,
>      'score' integer DEFAULT 0,
>      'title' text  COLLATE NOCASE,
>      'type' text  COLLATE NOCASE,
>      'url' text  COLLATE NOCASE,
>      'deleted' BOOLEAN DEFAULT 0,
>      'dead' BOOLEAN DEFAULT 0,
>      'comment' TEXT COLLATE NOCASE,
>      'time' integer NOT NULL,
>      descendants integer default 0
> );
>
> CREATE VIRTUAL TABLE fts_idx_items USING fts5(title, comment, content=items,
> content_rowid=id, prefix=3);
>
>
> The query:
>
> SQL    :  SELECT     a.id, a.parent, a.by, a.score,
>                  snippet(fts_idx_items, 0, '<em>', '</em>', '...',
> 12) as title,
>                  a.type, a.url,
>                  --snippet(fts_idx_items, 1, '<em>', '</em>',
> '...', 12) as comment,
>                  a.descendants,
>                  datetime(a."time", 'unixepoch') AS time,
>                  (julianday('now') - julianday(datetime(a."time",
> 'unixepoch'))) as elapsed_time
>              FROM items a, fts_idx_items b
>              where fts_idx_items match 'title:sql'
>              and a.id = b.rowid
>              --and a.type != 'comment'
>              ORDER BY rank --bm25(fts_idx_items)
>              LIMIT 30 OFFSET 0
>
> Generates:
>
> SQL    :    -- SELECT rowid, rank FROM 'main'.'fts_idx_items' ORDER BY
> bm25(fts_idx_items) ASC
>
> Followed by 28 of this:
>
> SQL    :    -- SELECT pgno FROM 'main'.'fts_idx_items_idx' WHERE
> segid=? AND term<=? ORDER BY term DESC LIMIT 1
>
> Followed by around 3,000 of:
>
> SQL    :    -- SELECT sz FROM 'main'.'fts_idx_items_docsize' WHERE id=?
>  
>
> Followed by 18 of:
>
> SQL    :    -- SELECT T.'id', T.'title', T.'comment' FROM
> 'main'.'items' T WHERE T.'id'=?
>
> SQL    :    -- SELECT sz FROM 'main'.'fts_idx_items_docsize' WHERE
> id=?
>
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: FTS5 problem ? more than 3,000 queries !

Domingo Alvarez Duarte-2
And the indexes are not supposed to be used ?  

Shouldn't a index cover the ranking too ?  

It seems a mistake for me.  

Cheers !  

>  Mon Apr 04 2016 11:07:51 AM CEST from "Dan Kennedy"
><[hidden email]>  Subject: Re: [sqlite] FTS5 problem ? more than 3,000
>queries !
>
>  On 04/04/2016 05:43 AM, Domingo Alvarez Duarte wrote:
>  
>>Hello !
>>
>> I'm testing fts5 on a database with data from hacker news (around 13M
>> records) and it took more than 2 hours to index, I have this application
>>to
>> log all queries executed for debugging and although the search isn't slow
>> it's making a lot of queries
>>
>> Is this normal ? More than 3,000 queries ?
>>

>  Probably. Your query does "ORDER BY rank" with "rank" set to the built
> in bm25() function. One of the things bm25() needs is the size of each
> document that it is ranking. And obtaining this requires a separate
> query on the %_sz table for each row. So if the MATCH expression matches
> 3000 rows, FTS5 makes 3000 SQL queries to obtain the size data.
>
> Dan.
>
>
>
>
>
>
>  
>>Cheers !
>>
>>
>>
>> CREATE TABLE "items" (
>> 'id' integer PRIMARY KEY,
>> 'parent' INTEGER,
>> 'by' text COLLATE NOCASE,
>> 'score' integer DEFAULT 0,
>> 'title' text COLLATE NOCASE,
>> 'type' text COLLATE NOCASE,
>> 'url' text COLLATE NOCASE,
>> 'deleted' BOOLEAN DEFAULT 0,
>> 'dead' BOOLEAN DEFAULT 0,
>> 'comment' TEXT COLLATE NOCASE,
>> 'time' integer NOT NULL,
>> descendants integer default 0
>> );
>>
>> CREATE VIRTUAL TABLE fts_idx_items USING fts5(title, comment,
>>content=items,
>> content_rowid=id, prefix=3);
>>
>>
>> The query:
>>
>> SQL : SELECT a.id, a.parent, a.by, a.score,
>> snippet(fts_idx_items, 0, '<em>', '</em>', '...',
>> 12) as title,
>> a.type, a.url,
>> --snippet(fts_idx_items, 1, '<em>', '</em>',
>> '...', 12) as comment,
>> a.descendants,
>> datetime(a."time", 'unixepoch') AS time,
>> (julianday('now') - julianday(datetime(a."time",
>> 'unixepoch'))) as elapsed_time
>> FROM items a, fts_idx_items b
>> where fts_idx_items match 'title:sql'
>> and a.id = b.rowid
>> --and a.type != 'comment'
>> ORDER BY rank --bm25(fts_idx_items)
>> LIMIT 30 OFFSET 0
>>
>> Generates:
>>
>> SQL : -- SELECT rowid, rank FROM 'main'.'fts_idx_items' ORDER BY
>> bm25(fts_idx_items) ASC
>>
>> Followed by 28 of this:
>>
>> SQL : -- SELECT pgno FROM 'main'.'fts_idx_items_idx' WHERE
>> segid=? AND term<=? ORDER BY term DESC LIMIT 1
>>
>> Followed by around 3,000 of:
>>
>> SQL : -- SELECT sz FROM 'main''fts_idx_items_docsize' WHERE id=?
>>
>>
>> Followed by 18 of:
>>
>> SQL : -- SELECT T.'id', T.'title', T.'comment' FROM
>> 'main'.'items' T WHERE T.'id'=?
>>
>> SQL : -- SELECT sz FROM 'main'.'fts_idx_items_docsize' WHERE
>> id=?
>>
>> _______________________________________________
>> sqlite-users mailing list
>> [hidden email]
>> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>>

>  _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
>
>  

 

 

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Difference between sqlite3 executable and application

Domingo Alvarez Duarte-2
In reply to this post by Simon Slavin-3
Thanks for reply !  

Executing "PRAGMA compile_options;"  

My application:  

ENABLE_COLUMN_METADATA
ENABLE_FTS3
ENABLE_FTS3_PARENTHESIS
ENABLE_FTS4
ENABLE_FTS5
ENABLE_JSON1
ENABLE_RTREE
ENABLE_STAT4
ENABLE_UNLOCK_NOTIFY
HAS_CODEC
OMIT_TCL_VARIABLE
SOUNDEX
SYSTEM_MALLOC
THREADSAFE=1  

sqlite3 application (shell):  

ENABLE_COLUMN_METADATA
ENABLE_FTS3
ENABLE_FTS3_PARENTHESIS
ENABLE_FTS4
ENABLE_FTS5
ENABLE_JSON1
ENABLE_RTREE
ENABLE_STAT4
ENABLE_UNLOCK_NOTIFY
HAS_CODEC
HAVE_ISNAN
SMALL_STACK
SOUNDEX
SYSTEM_MALLOC
THREADSAFE=1  

I do not see something significant here to justify sqlite3 using indexes and
my application not using then.  

Cheers !  

>  Mon Apr 04 2016 10:59:17 AM CEST from "Simon Slavin"
><[hidden email]>  Subject: Re: [sqlite] Difference between sqlite3
>executable and application
>
>  On 4 Apr 2016, at 9:53am, Domingo Alvarez Duarte
><[hidden email]> wrote:
>
>  
>>What compile time options if any can cause this ?
>>

>  I recommend you compare the results of
>
> PRAGMA compile_options;
>
> on the two platforms.
>
> Simon.
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
>
>  

 

 

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Difference between sqlite3 executable and application

Domingo Alvarez Duarte-2
In reply to this post by Simon Slavin-3
Compile time options used:  

sqlite3 application (shell):  

gcc
-g
-O2
-DSQLITE_OS_UNIX=1
-I.
-Isqlite3/src
-Isqlite3/ext/rtree
-Isqlite3/ext/icu
-Isqlite3/ext/fts3
-Isqlite3/ext/async
-Isqlite3/ext/session
-D_HAVE_SQLITE_CONFIG_H
-DBUILD_sqlite
-DSQLITE_HAS_CODEC=1
-DSQLITE_ENABLE_FTS4=1
-DSQLITE_ENABLE_FTS3
-DSQLITE_ENABLE_RTREE=1
-DSQLITE_ENABLE_COLUMN_METADATA=1
-DSQLITE_ENABLE_FTS3_PARENTHESIS=1
-DSQLITE_DEFAULT_FOREIGN_KEYS=1
-DSQLITE_USE_URI=1
-DSQLITE_ENABLE_UNLOCK_NOTIFY=1
-DSQLITE_USE_DECIMAL2=1
-DSQLITE_ENABLE_STAT4=1
-DCODEC_TYPE=CODEC_TYPE_AES2562
-DSQLITE_SOUNDEX=1
-DSQLITE_ENABLE_EXTENSION_FUNCTIONS=1
-DSQLITE_OMIT_PREPARED=1
-DSQLITE_ENABLE_SESSION=1
-DNDEBUG
-DSQLITE_THREADSAFE=1
-DSQLITE_ENABLE_FTS5
-DSQLITE_ENABLE_JSON1
-DSQLITE_OMIT_PREPARED=1
-DSQLITE_ENABLE_SESSION
-DSQLITE_ENABLE_PREUPDATE_HOOK
-DSQLITE_SMALL_STACK=1
-DHAVE_READLINE=0
-DHAVE_EDITLINE=1
-DSQLITE_ENABLE_JSON1
-DSQLITE_ENABLE_FTS4
-DSQLITE_ENABLE_EXPLAIN_COMMENTS
-o
sqlite3
sqlite3/src/shell.c
sqlite3.c

-ledit
-ldl
-lpthread
-lm
-Wl,-rpath
-Wl,/usr/local/lib  

   

My application:  

gcc
-Wall
-fno-strict-aliasing
-DSQ_ENABLE_INCLUDES=1
-DSQ_USE_MKSTEMP=1
-DSQ_USE_LOCALTIME_R=1
-DONLY_ASCII=1
-DPROFILE_SQVM0=1
-DSQ_JIT_LLVM44=1
-D_DEBUG_DUMP33=1
-DWITH_DAD_EXTRAS=1
-DSQ_SUBLATIN=1
-DNEED_SUBLATIN_C2=1
-DSQUSEDOUBLE=1
-DSQUSEDECIMAL64x=1
-DNO_EXCEPTION_KEY_NOT_FOUND0=1
-DNO_GARBAGE_COLLECTOR00=1
-DTHREADSAFE=1
-DSQLITE_DEFAULT_FILE_FORMAT=4
-DSQLITE_DEFAULT_AUTOVACUUM=1
-DSQLITE_DEFAULT_FOREIGN_KEYS=1
-DSQLITE_ENABLE_COLUMN_METADATA=1
-DSQLITE_ENABLE_EXTENSION_FUNCTIONS=1
-DSQLITE_ENABLE_FTS4=1
-DSQLITE_ENABLE_FTS5=1
-DSQLITE_ENABLE_FTS3_PARENTHESIS=1
-DSQLITE_ENABLE_UNLOCK_NOTIFY=1
-DSQLITE_ENABLE_RTREE=1
-DSQLITE_ENABLE_STAT4=1
-DSQLITE_HAS_CODEC=1
-DSQLITE_OMIT_TCL_VARIABLE=1
-DSQLITE_USE_URI=1
-DSQLITE_SOUNDEX=1
-DSQLITE_OMIT_PREPARED=1
-DSQLITE_ENABLE_JSON1=1
-DSQLITE_ENABLE_SESSION=1
-DSQLITE_ENABLE_EXPLAIN_COMMENTS=1
-DNO_POPEN=1
-DNO_SSL_DL=1
-DHAVE_STDINT=1
-DUSE_AXTLS=1
-DUSE_OPENSSL2=1
-DUSE_AXTLS_ON_MEMORY=1
-D_FILE_OFFSET_BITS=64
-DSSL_STATIC_LIBRARY=1
-DPDF_USING_ZLIB=1
-DRS232_STATIC=1
-DWITH_UUID=1
-DWITH_FFI=1
-DWITH_POSTGRESQL=1
-DWITH_LIBCLANG=1
-DWITH_MPDECIMAL=1
-DSQ_USE_EASYCURL=1
-fomit-frame-pointer
-fexpensive-optimizations
-O3
-Wall
-DWITH_FLTK=1
-DNDEBUG=1
-DWITH_FULL_DAD_EXTRAS=1
-DPROFILE_SQVM22=1
-D_SQ64=1
-DCONFIG_64=1
-DHAS_UNIX_DOMAIN_SOCKETS=1
-DUSE_SIGNAL_HANDLER=1
-DWITH_MYSQL=1
-DWITH_POSTGRESQL=1
-DWITH_DNS_SD2=1
-Iinclude
-Isqstdlib
-I../myaxtls
-I../discount
-I../../../local/postgresql/include
-I/usr/lib/jvm/default-java/include
-I/usr/lib/llvm-3.1/include
-I../SquiLu-ext/threadObject
-I..
-I../SquiLu-ext
-I/usr/include/mysql
-I../gumbo
-I../minizip
-I../unql/src
-I../../../local/clang-3.6/include
-I../../../local/include
-I../../zeromq-3.2.2/include
-I../fltk
-I../libharu/include
-I../flu
-c
SquiLu/SquiLu-ext/sqlite3.c
-o
obj/Release/SquiLu-ext/sqlite3.o  

   

   

>  Mon Apr 04 2016 10:59:17 AM CEST from "Simon Slavin"
><[hidden email]>  Subject: Re: [sqlite] Difference between sqlite3
>executable and application
>
>  On 4 Apr 2016, at 9:53am, Domingo Alvarez Duarte
><[hidden email]> wrote:
>
>  
>>What compile time options if any can cause this ?
>>

>  I recommend you compare the results of
>
> PRAGMA compile_options;
>
> on the two platforms.
>
> Simon.
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
>
>  

 

 

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Difference between sqlite3 executable and application

Simon Slavin-3
In reply to this post by Domingo Alvarez Duarte-2

On 4 Apr 2016, at 10:19am, Domingo Alvarez Duarte <[hidden email]> wrote:

> I do not see something significant here to justify sqlite3 using indexes and
> my application not using then.  

For the SQLite shell tool, are you opening the same database file or are you entering CREATE TABLE commands ?

Simon.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Difference between sqlite3 executable and application

Domingo Alvarez Duarte-2
It would be a gross mistake if the databases weren't the same.  

It's an existing and populated database.  

   

>  Mon Apr 04 2016 11:31:45 AM CEST from "Simon Slavin"
><[hidden email]>  Subject: Re: [sqlite] Difference between sqlite3
>executable and application
>
>  On 4 Apr 2016, at 10:19am, Domingo Alvarez Duarte
><[hidden email]> wrote:
>
>  
>>I do not see something significant here to justify sqlite3 using indexes
>>and
>> my application not using then.
>>

>  For the SQLite shell tool, are you opening the same database file or are
>you entering CREATE TABLE commands ?
>
> Simon.
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
>
>  

 

 

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Difference between sqlite3 executable and application

Simon Slavin-3

On 4 Apr 2016, at 10:47am, Domingo Alvarez Duarte <[hidden email]> wrote:

> It would be a gross mistake if the databases weren't the same.  
>
> It's an existing and populated database.

The only thing that comes to mind is that one app is using case sensitive and the other is not.  Unfortunately the command to check the status seems to be missing from the documentation and therefore possibly missing from SQLite.

In both apps, before executing

select * from companies where post_code like 'rg%'

execute

PRAGMA case_sensitive_like = ON

and see what happens.  Then perhaps try it off.

<https://www.sqlite.org/pragma.html#pragma_case_sensitive_like>

Simon.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Difference between sqlite3 executable and application

Domingo Alvarez Duarte-2
Thanks for reply !  

If I issue this command :  

PRAGMA case_sensitive_like = OFF;  

Then I get the same answer (I mean it uses indexes now):  

explain query plan select * from companies where post_code like 'rg%';  

SEARCH TABLE companies USING INDEX companies_post_code_idx (post_code>? AND
post_code<?)  

It seems strange why sqlite is not using the indexes with the default
case_sensitive_like settings, here is the schema:  

CREATE TABLE companies(
        id integer primary key,
        name text collate nocase,
        number text,
        care_of text collate nocase,
        po_box text collate nocase,
        address text collate nocase,
        address2 text collate nocase,
        post_town_id integer,
        county_id integer,
        country_id integer,
        post_code text collate nocase,
        category_id integer,
        status_id integer,
        country_of_origin_id integer,
        dissolution_date date,
        incorporation_date date,
        account_ref_day text,
        account_ref_month text,
        account_next_due_date date,
        account_last_made_up_date date,
        account_category_id integer,
        returns_next_due_date date,
        returns_last_made_up_date date,
        mortages_charges integer,
        mortages_outstanding integer,
        mortages_part_satisfied integer,
        mortages_satisfied integer,
        general_partners integer,
        limited_partners integer
    );  

CREATE INDEX companies_incorporation_date_idx ON companies
(incorporation_date);

CREATE INDEX companies_name_idx ON companies (name);

CREATE INDEX companies_number_idx ON companies (number);

CREATE INDEX companies_post_code_idx ON companies (post_code);

 

   

>  Mon Apr 04 2016 12:39:35 PM CEST from "Simon Slavin"
><[hidden email]>  Subject: Re: [sqlite] Difference between sqlite3
>executable and application
>
>  On 4 Apr 2016, at 10:47am, Domingo Alvarez Duarte
><[hidden email]> wrote:
>
>  
>>It would be a gross mistake if the databases weren't the same.
>>
>> It's an existing and populated database.
>>

>  The only thing that comes to mind is that one app is using case sensitive
>and the other is not. Unfortunately the command to check the status seems to
>be missing from the documentation and therefore possibly missing from SQLite.
>
> In both apps, before executing
>
> select * from companies where post_code like 'rg%'
>
> execute
>
> PRAGMA case_sensitive_like = ON
>
> and see what happens. Then perhaps try it off.
>
> <https://www.sqlite.org/pragma.html#pragma_case_sensitive_like>
>
> Simon.
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
>
>  

 

 

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: C API reference manpages

Jonathan Moules-3
In reply to this post by Kristaps Dzonsons
How about the CC0 license?
I think it's designed for these sorts of things (you want to make something public domain even if you're not allowed to) - https://creativecommons.org/about/cc0/

---- On Fri, 01 Apr 2016 00:05:30 +0100 Kristaps Dzonsons &lt;[hidden email]&gt; wrote ----

&gt;&gt; As for public domain, I'm happy to put the sources under a similar
&gt;&gt; license. I can't speak for the voodoo of the public domain and the EU
&gt;&gt; (or is it country-by-country?), however.
&gt;
&gt; From an English translation I found of the Latvian law includes moral
&gt; rights and is closer to the droit d'auteur than copyright. So it seems
&gt; difficult to place your work in the public domain.
&gt;
&gt; I would advise you to contact the FSF, FSFE Legal or SFLC in this matter
&gt; if you want a general advice without legal fees. This entire topic as
&gt; been discussed in context of Wikimedia's projects, especially Wikipedia
&gt; and Wikimedia Commons, and CC0, so you might find information about
&gt; Latvia there.
 
Matthias-Christian,
 
I'm afraid I can't say anything useful about licenses, but in searching
around, it appears that you're correct[1].





_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: C API reference manpages

Kristaps Dzonsons
> How about the CC0 license? I think it's designed for these sorts of
> things (you want to make something public domain even if you're not
> allowed to) - https://creativecommons.org/about/cc0/

Jonathon,

I think the problem is that LV is similar to Norway[1] in this regard,
so something like CC0 doesn't work as one would expect it to.  However,
the manpages generated by sqlite2mdoc are in whatever license (or
no-license) you want, so at the end of the day, it doesn't affect the
library or its included documentation.  (After all, tcl isn't PD, and
that's required as it is!)

Licensing aside, if anybody has any comments or issues on the tool or
its mdoc(7) output, let me know!

Best,

Kristaps

[1]
http://lists.ibiblio.org/pipermail/cc-community/2014-October/thread.html#8863
(``Open Definition 2.0 released'')



_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

signature.asc (859 bytes) Download Attachment
123