6d2779e6ec
add first sql based unit test. |
||
---|---|---|
src | ||
.gitignore | ||
Cargo.toml | ||
Makefile | ||
README.md | ||
pg_str.control |
README.md
pg_str: the postgresql extension for strings
add some good default string manipulation functions to postgresql. build using the rust library pgrx: https://github.com/pgcentralfoundation/pgrx.
function api and behavior is inspired by the laravel web framework: https://laravel.com/docs/10.x/strings
installation
git clone https://gitea.publicmatt.com/public/pg_str.git
cd pg_str
cargo pgx package # run cargo install pgx first
sudo make install # adjust Makefile if using different version of postgresql than 13.
this puts the binaries and sql into the right folder location. next you need to create the extension in postgresql:
psql
> create extension pg_str; # installs functions in a 'public' schema.
> select str_markdown('# Hello '
|| str.snake('pg str')
|| '- ~~using programming language for str manipulations~~
- **do it all in postgresql** ');
api thus far:
- after
- [] afterLast
- ascii
- [] before
- [] beforeLast
- [] between
- camel
- contains
- containsAll
- [] endsWith
- [] finish
- [] headline
- [] is
- isAscii
- [] isUuid
- kebab
- length
- [] limit
- lower
- markdown
- [] mask
- [] orderedUuid
- [] padBoth
- [] padLeft
- [] padRight
- plural
- [] pluralStudly
- random
- [] remove
- replace
- [] replaceArray
- [] replaceFirst
- [] replaceLast
- [] reverse
- singular
- slug
- snake
- start
- [] startsWith
- studly
- substr
- [] substrCount
- [] substrReplace
- title
- [] ucfirst
- upper
- uuid
- [] wordCount
- [] words