nalgeon / sqlean

The ultimate set of SQLite extensions
MIT License
3.65k stars 115 forks source link

extension for a specific string function: reverse() #9

Closed wbob closed 3 years ago

wbob commented 3 years ago

https://github.com/mayflower/sqlite-reverse-string was useful to me once, it has no dependencies, but could be obsoleted by a library encompassing more string functions

little-brother commented 3 years ago

It's already implemented in math extension.

provide mathematical and string extension functions for SQL queries using the loadable extensions mechanism. Math: acos, asin, atan, atn2, atan2, acosh, asinh, atanh, difference, degrees, radians, cos, sin, tan, cot, cosh, sinh, tanh, coth, exp, log, log10, power, sign, sqrt, square, ceil, floor, pi. String: replicate, charindex, leftstr, rightstr, ltrim, rtrim, trim, replace, reverse, proper, padl, padr, padc, strfilter. Aggregate: stdev, variance, mode, median, lower_quartile, upper_quartile.

nalgeon commented 3 years ago

It's not. math extension contains only math functions. I don't know the source of your quote, but it's not the docs.

little-brother commented 3 years ago

https://www.sqlite.org/contrib https://www.sqlite.org/contrib/download/extension-functions.c?get=25

nalgeon commented 3 years ago

This is an old third-party extension, which has nothing to do with math extension.

little-brother commented 3 years ago

Yeah, I missed that you are using another math extension.

warmwaffles commented 3 years ago

@nalgeon sounds like that reverse would actually be useful to have in the unicode extension since that is dealing with strings in general.

nalgeon commented 3 years ago

I am working on the text extension, reverse() will be there.

nalgeon commented 3 years ago

Done.

wbob commented 3 years ago

thank you! I was pleasantly suprised you included split_part (substring_index for mysqlers) too, an often used function