Go to file
Matt Public e91c8fd354 prefix fn with str_.
fix random.

add after.
2023-02-19 13:32:12 -08:00
src prefix fn with str_. 2023-02-19 13:32:12 -08:00
.gitignore init fork from abumni/pg_str 2023-02-13 21:22:29 -08:00
Cargo.toml init fork from abumni/pg_str 2023-02-13 21:22:29 -08:00
Makefile init fork from abumni/pg_str 2023-02-13 21:22:29 -08:00
README.md prefix fn with str_. 2023-02-19 13:32:12 -08:00
pg_str.control init fork from abumni/pg_str 2023-02-13 21:22:29 -08:00

README.md

Postgresql String Extension

A better way of handling string manipulation and transformations in Postgresql.

Function api and behavior is inspired by those available in the Laravel web framework: https://laravel.com/docs/8.x/helpers#strings-method-list

Installation

git clone git@github.com:abumni/pg_str
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 schema named 'str'
> select str.markdown('# Hello '
|| str.snake('pg str')
|| '- ~~using programming language for str manipulations~~ 
- **do it all in postgresql** ');

API

  • 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