Glob documentation clarity

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Glob documentation clarity

Jonathan Moules-3
I'm looking at https://sqlite.org/lang_corefunc.html#glob - and glob()
seemed like it might help me with a problem.

But the docs don't actually say what X and Y are. Which is the needle
and which is the haystack? It does say "The glob(X,Y) function is
equivalent to the expression "Y GLOB X"." - but having never used GLOB
before in SQL, that's no help.

Going on to the GLOB language page
(https://sqlite.org/lang_expr.html#glob) doesn't provide any clarity either.

Could I suggest explicitly specifying which is the needle and which is
the haystack as is done for "instr", "substr" etc.

Thanks,

Jonathan

p.s. (Apparently X is the needle and Y is the haystack, but I had to get
that from a source external to the docs)


_______________________________________________
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: Glob documentation clarity

William Chargin
I think that you can infer it from the statement that "The GLOB operator
is similar to LIKE". The documentation for the "LIKE" operator notes
explicitly that the right-hand operand is the pattern (needle) and the
left-hand operand is the string to match against the pattern (haystack).

That said, it wouldn't hurt to reiterate this in the docs for "GLOB" and
the other functions/operators in this category.

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