Re: [sqlite] [EXTERNAL] virtual tables, xBestIndex, pIdxInfo->aConstraint[].op, and 'NOT'...

2018-10-16 Thread Richard Hipp
On 10/16/18, dave  wrote:
>
> And also the meaning/use of SQLITE_INDEX_CONSTRAINT_FUNCTION, that would be
> super helpful.
>

The SQLITE_INDEX_CONSTRAINT_FUNCTION mechanism was added to support
the new Geopoly extension, and the ability to index on things like
"WHERE geopoly_within(_shape,...)" and "WHERE
geopoly_overlap(_shape,...)".  There is little to no documentation on
the SQLITE_INDEX_CONSTRAINT_FUNCTION mechanism yet.  See the geopoly
implementation for an example.

-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] [EXTERNAL] virtual tables, xBestIndex, pIdxInfo->aConstraint[].op, and 'NOT'...

2018-10-16 Thread dave
> Behalf Of Keith Medcalf
> Sent: Saturday, October 13, 2018 6:53 PM
...
> 
> > Lastly, I'm assuming that 'IS' and 'IS NOT' is functionally 
> > equivalent to the '=' and '<>' operators?  
> > Or is there some subtle difference
> 
> As long as neither the LHS or the RHS are null, then IS and 
> IS NOT are the same as == and <> respectively.
> 
> However, if you use the "comparison" operators (==, <>) then 
> if either the LHS or the RHS or both are NULL, then the 
> results is NULL (that is, false).  For the purpose of these 
> comparisons NULL is a value that is neither equal to nor not 
> equal to any other value, including null.
> 
> IS and IS NOT mean that NULL is a distinct value and NULL IS 
> NULL is TRUE, NULL IS NOT 7 is TRUE, and so on and so forth.
> 

Thanks for the confirmation of the behaviour of 'is' in sqlite.

And if anyone has comnments regarding the first two issues I mentioned,
namely the absence of support of 
  NOT MATCH, NOT LIKE, NOT GLOB, NOT REGEXP
in xBestIndex()

And also the meaning/use of SQLITE_INDEX_CONSTRAINT_FUNCTION, that would be
super helpful.

Cheers!

-dave


___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLITE_ENABLE_UPDATE_DELETE_LIMIT

2018-10-16 Thread Olivier Mascia
> Le 16 oct. 2018 à 16:39, Olivier Mascia  a écrit :
> 
> https://www.sqlite.org/compile.html#enable_update_delete_limit
...
> I can manage to run the build tools properly, for the target sqlite3.c or 
> sqlite_analyzer.exe for instance. I'm just not confident yet as to where to 
> start to patch the configuration so that I can lean to such an updated 
> sqlite3.c file (without breaking anything).

For now, I think I should be safe (it looks like it works), starting from the 
snapshop of the complete (raw) source tree (zip file), by just adding those 
lines (marked below with ---) right after all the other conditionals to add 
other features (in Makefile.msc).

Then doing 'nmake -f Makefile.msc sqlite3.c'

> !IF $(SESSION)!=0
> OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_SESSION=1
> OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_PREUPDATE_HOOK=1
> !ENDIF
> 
> --- # Enable the optional UPDATE_DELETE_LIMIT feature
> --- OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) 
> -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT=1
> 
> # These are the "extended" SQLite compilation options used when compiling for
> # the Windows 10 platform.
> #

The build (of sqlite3.c) with that modification runs OK (I have dependency 
tools pre-installed). In addition, I compile my own projects with that 
amalgamation .c and .h files (defining SQLITE_ENABLE_UPDATE_DELETE too) just 
fine and what's more the feature works properly for my use case. :)

So I'm just looking for guidance / confirmation that I'm not missing anything 
in this process.

-- 
Best Regards, Meilleures salutations, Met vriendelijke groeten,
Olivier Mascia


___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] SQLITE_ENABLE_UPDATE_DELETE_LIMIT

2018-10-16 Thread Olivier Mascia
https://www.sqlite.org/compile.html#enable_update_delete_limit

> SQLITE_ENABLE_UPDATE_DELETE_LIMIT
> 
> This option enables an optional ORDER BY and LIMIT clause on UPDATE and 
> DELETE statements.
> 
> If this option is defined, then it must also be defined when using the Lemon 
> parser generator tool to generate a parse.c file.


What minimal changes do I need to do to a single / multiple configuration 
file(s) of the source tree to be able to produce the sqlite3.c amalgamation 
with this feature turned on and everything else carefully configured as the 
default amalgamation file?  So that I get an amalgamation file functionally 
equivalent to the one distributed, except for this feature properly pre-enabled 
(presumably through compiling that amalgamation with 
SQLITE_ENABLE_UPDATE_DELETE_LIMIT too).

Is this even possible, or is a complete standalone build required?

It would help if I could just rebuild a correctly configured new amalgamation 
upon releases, and then keep my integration process clean, re-using the built 
amalgamation source file in my programs. It better fits my production process 
(using MSVC 2017).

I can manage to run the build tools properly, for the target sqlite3.c or 
sqlite_analyzer.exe for instance. I'm just not confident yet as to where to 
start to patch the configuration so that I can lean to such an updated 
sqlite3.c file (without breaking anything).

By the way...
This was clearly designed to keep this feature out of access except on very 
specific needs.  Is it because the syntax behind is far from being standard or 
common on other engines?  Or because it implies a significant increase in code 
size or execution time, so is not eligible for the default amalgamation?

-- 
Best Regards, Meilleures salutations, Met vriendelijke groeten,
Olivier Mascia


___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] [SQLITE] 3 questions.(tokenize in fts5)(number of highlights)(ignoring syntax errors for searching "symbols")

2018-10-16 Thread Maziar Parsijani
Hi,
I have 3 questions on the below query:

> SELECT searchsimpleenhanced.rowid,
>
> searchsimpleenhanced.*,
>
> fatrans.text AS trans,
>
> searchfast.text,
>
> highlight(fatrans, 0, '', '') mjp
>
> FROM searchsimpleenhanced
>
> JOIN
>
> fatrans ON fatrans.rowid = searchsimpleenhanced.rowid
>
> JOIN
>
> searchfast ON searchfast.rowid = fatrans.rowid
>
> WHERE fatrans MATCH 'فارسی' ;
>
First :
How could I count the number of highlights?(not the number of rows)
Second :
if I have 2 columns with Arabic text like this :
column 1 : *"الحمد لله رب العالمین "*
column 2 :
*"الْحَمْدُ لِلَّهِ رَبِّ الْعَالَمِينَ "*
I want to know if there are any way to search for a match in column 1 for
example "*رب*" but I can select the same match in column 2 without
searching by its position in the string.Because in the both columns the "
*رب*" is the third word and now I want to find it on column 1 and select
the third word on column 2.
Third :
I want to know if there are anyway to get rid of syntax error during search
for "?,[].."and such symbols.
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users