Re: [sqlite] OR statement in LIKE

2018-05-10 Thread Keith Medcalf

You could probably use the one in Sqlite3 as well, rather than a third party 
one ...

https://www.sqlite.org/src/artifact/a68d25c659bd2d89


---
The fact that there's a Highway to Hell but only a Stairway to Heaven says a 
lot about anticipated traffic volume.


>-Original Message-
>From: sqlite-users [mailto:sqlite-users-
>boun...@mailinglists.sqlite.org] On Behalf Of Jens Alfke
>Sent: Thursday, 10 May, 2018 12:54
>To: SQLite mailing list
>Subject: Re: [sqlite] OR statement in LIKE
>
>
>
>> On May 10, 2018, at 10:27 AM, Stephen Chrzanowski
> wrote:
>>
>> select * from SomeComments where Comment like 'Beginning%|%End'
>
>
>Don’t try to reinvent regular expressions! If you add a SQLite
>extension that defines a regexp() function, such as this one (which
>I’ve never used)
>   https://github.com/eatnumber1/sqlite-regexp
>
>then you can write that query as:
>   select * from SomeComments where Comment regexp
>'(^Beginning)|(End$)'
>(Apologies if I’m misremembering my regex syntax!)
>
>—Jens
>___
>sqlite-users mailing list
>sqlite-users@mailinglists.sqlite.org
>http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users



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


Re: [sqlite] OR statement in LIKE

2018-05-10 Thread Jens Alfke


> On May 10, 2018, at 10:27 AM, Stephen Chrzanowski  wrote:
> 
> select * from SomeComments where Comment like 'Beginning%|%End'


Don’t try to reinvent regular expressions! If you add a SQLite extension that 
defines a regexp() function, such as this one (which I’ve never used)
https://github.com/eatnumber1/sqlite-regexp 

then you can write that query as:
select * from SomeComments where Comment regexp '(^Beginning)|(End$)'
(Apologies if I’m misremembering my regex syntax!)

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


Re: [sqlite] OR statement in LIKE

2018-05-10 Thread Dennis Clarke

On 05/10/2018 01:48 PM, David Raymond wrote:

Insert usual comment of "the more you add, the less 'Lite' it becomes"




Saw this and thought "brilliant".
Exactly.

The UNIX way is to do one thing and do it well and move on.
Not seventy five things poorly.


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


Re: [sqlite] OR statement in LIKE

2018-05-10 Thread David Raymond
Insert usual comment of "the more you add, the less 'Lite' it becomes"

Rather than changing LIKE, which would probably be bad, adding in something 
akin to Postgres's SIMILAR TO is a better idea.

https://www.postgresql.org/docs/10/static/functions-matching.html

I'd be of the opinion that going past that to full regular expression support 
is best left to extensions rather than the base SQLite.


SELECT * FROM SomeComments WHERE Comment IS SOMETHING ALONG THE LINES OF 
'Beginning%|%End';


-Original Message-
From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On 
Behalf Of Stephen Chrzanowski
Sent: Thursday, May 10, 2018 1:28 PM
To: General Discussion of SQLite Database
Subject: [sqlite] OR statement in LIKE

I can't remember if I asked this before.  Went to google and didn't find an
answer.

Could there be a plan put in place that would including an "OR" mask
character?

The reason I ask is that I've got a user input field that searches the
required field in a database using % as the "AND" statement, but, I'd like
to expand to include using "OR" as well, but, not have to rely on my
software to regenerate a SQL statement with multiple [Field LIKE
'%UserInput%"] statements.

I'd expect the LIKE to work the same as the % mask works now, in that each
OR statement is queried against the position of that mask.  So

select * from SomeComments where Comment like 'Beginning%|%End'

would return results where the SomeComments field begins with "Beginning"
or ends with "End".
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] OR statement in LIKE

2018-05-10 Thread Stephen Chrzanowski
I can't remember if I asked this before.  Went to google and didn't find an
answer.

Could there be a plan put in place that would including an "OR" mask
character?

The reason I ask is that I've got a user input field that searches the
required field in a database using % as the "AND" statement, but, I'd like
to expand to include using "OR" as well, but, not have to rely on my
software to regenerate a SQL statement with multiple [Field LIKE
'%UserInput%"] statements.

I'd expect the LIKE to work the same as the % mask works now, in that each
OR statement is queried against the position of that mask.  So

select * from SomeComments where Comment like 'Beginning%|%End'

would return results where the SomeComments field begins with "Beginning"
or ends with "End".
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Typo in documentation for .sha3sum CLI command

2018-05-10 Thread Aaron Zeng
Hi folks,

The documentation
 for
the .sha3sum CLI command indicates that the default variety of SHA-3 used
is SHA-256, but (at least on 3.19.3) when the command is run without
options, I get a 56-hex digit output, indicating SHA3-224.  SHA3-256 would
produce a 64-hex digit output.  I suppose this could be a bug in the CLI
rather than documentation.

Also, there is a minor typo in the options help for .sha3sum that is shown
when an unrecognized option is passed:

> .sha3sum -h
Unknown option "-h" on "sha3sum"
Should be one of: --schema --sha3-224 --sha3-255 --sha3-384 --sha3-512

"sha3-255" should be "sha3-256".  The command recognizes the latter but not
the former.

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


[sqlite] '.open' without args crashes shell

2018-05-10 Thread Abroży Nieprzełoży
SQLite version 3.24.0 2018-05-09 16:32:00
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> .version
SQLite 3.24.0 2018-05-09 16:32:00
9f7a6ae878cd17ff4de7c55e654406773e0ea2b9fe1c4e2a9fc2b0da84d059a4
zlib version 1.2.11
msvc-1912
sqlite> .open
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users