Go to file
matt 6d2779e6ec extract str functions into separate modules.
add first sql based unit test.
2023-12-14 15:18:13 -08:00
src extract str functions into separate modules. 2023-12-14 15:18:13 -08:00
.gitignore init fork from abumni/pg_str 2023-02-13 21:22:29 -08:00
Cargo.toml extract str functions into separate modules. 2023-12-14 15:18:13 -08:00
Makefile extract str functions into separate modules. 2023-12-14 15:18:13 -08:00
README.md extract str functions into separate modules. 2023-12-14 15:18:13 -08:00
pg_str.control remove schema default. 2023-02-19 13:32:51 -08:00

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