Skip to content

Latest commit

 

History

History
39 lines (26 loc) · 929 Bytes

02-development.md

File metadata and controls

39 lines (26 loc) · 929 Bytes

Development

Set up development environment

  1. Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  1. Clone the Repository
git clone https://github.com/silver-ymz/pg_tokenizer.rs
cd pg_tokenizer.rs
  1. Install cargo-pgrx
cargo install cargo-pgrx --version $(grep -o 'pgrx = "=[^"]*' Cargo.toml | cut -d = -f 3)
cargo pgrx init

Debug

Debug information is enabled in debug and dev-opt profiles. You can build the extension with debug information by specifying the profile. And then you can use gdb to debug the extension.

cargo pgrx build # no compiler optimization
cargo pgrx build --profile dev-opt # with compiler optimization

When setting environment variable RUST_BACKTRACE=1, you can get a backtrace when the program panics.

RUST_BACKTRACE=1 cargo pgrx run --profile dev-opt