Go to file
publicmatt 5c49c2397a add pad left, right and both 2024-02-09 14:43:52 -08:00
src add pad left, right and both 2024-02-09 14:43:52 -08:00
.gitignore init fork from abumni/pg_str 2023-02-13 21:22:29 -08:00
Cargo.toml add pad left, right and both 2024-02-09 14:43:52 -08:00
Makefile extract str functions into separate modules. 2023-12-14 15:18:13 -08:00
README.md add before and before last. 2023-12-19 20:31:32 -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