Skip to content

Releases: fakhrulnugroho/pgrs

v0.9.0

Choose a tag to compare

@fakhrulnugroho fakhrulnugroho released this 06 Jul 06:21

What's Changed

🚀 New Features

  • \edit/\e: buka editor multiline reedline khusus untuk menulis/mengedit SQL panjang, jalankan otomatis saat submit
  • REPL line history kini persisten per-koneksi (~/.pgrs/history-<koneksi>), ditulis setelah setiap perintah — bertahan lintas restart/crash
  • \history <n>: jumlah riwayat terbaru kini bisa dikonfigurasi
  • Mode expanded \x kini melipat nilai panjang ke lebar terminal
  • Parsing argumen quote-aware untuk \save/\run/\unsave — nama dengan spasi bisa dikutip

🐛 Bug Fixes

  • Deteksi statement selesai di REPL kini melewati komentar SQL dan dollar-quote, sehingga tidak salah membaca apostrof/; di dalamnya

Changed

  • Perintah \-prefixed yang tidak dikenal kini menampilkan pesan error, bukan diteruskan ke Postgres
  • Konfirmasi keluar kini via reedline — Ctrl-C/Ctrl-D keluar bersih
  • Pesan usage backslash-command diseragamkan

Full Changelog: v0.8.0...v0.9.0

v0.8.0

Choose a tag to compare

@fakhrulnugroho fakhrulnugroho released this 09 Jun 12:16

What's Changed

🚀 New Features

  • Saved queries — simpan & putar ulang SQL favorit per-koneksi: \save <nama> <id>, \saved, \run <nama>, \unsave <nama> (persisten di ~/.pgrs/pgrs.db)
  • \explain / \explain+ — render plan EXPLAIN sebagai pohon ASCII; \explain+ menambah ANALYZE
  • Auto pager — output panjang dialirkan ke $PAGER (fallback less -SR) saat melebihi tinggi terminal; toggle via \pager
  • REPL transaction-aware — alias \begin/\commit/\rollback, indikator status transaksi di prompt, dan konfirmasi-rollback saat keluar dengan transaksi terbuka

🔁 Changed

  • DML transaction guardINSERT/UPDATE/DELETE ditolak di REPL kecuali ada transaksi terbuka (jalankan BEGIN dulu); connect/psql tidak terpengaruh

Full Changelog: v0.7.0...v0.8.0

v0.7.0

Choose a tag to compare

@fakhrulnugroho fakhrulnugroho released this 07 Jun 12:49

What's Changed

⚠️ Breaking (internal): pgrs is now a Cargo workspace split into two crates — pgrs-core (logic) and pgrs-cli (the pgrs binary). The CLI behavior is unchanged; this only affects anyone consuming the code as a library.

🚀 New Features

  • Postgres query errors kini menampilkan SQLSTATE code, detail/hint, dan penanda caret (^) pada posisi error — pesan error jauh lebih informatif

🐛 Bug Fixes

  • \stats <table> tidak lagi kosong — penggunaan kolom nyata kini direkam dengan benar
  • Path data dir yang bukan UTF-8 kini memunculkan error eksplisit (tidak lagi fallback diam-diam)

🧹 Internal / Refactoring

  • Kode dipecah menjadi workspace pgrs-core + pgrs-cli dengan boundary hexagonal yang ditegakkan compiler
  • pg_catalog lookups & klasifikasi SQL (DDL/DML) dipindah ke core
  • Error port diseragamkan ke DomainError; service membubble-up error alih-alih eprintln!
  • DI analytics/schema dipindah ke composition root

Full Changelog: v0.6.0...v0.7.0

v0.6.0

Choose a tag to compare

@fakhrulnugroho fakhrulnugroho released this 30 May 09:11

What's Changed

🚀 New Features

  • Tab-completion suggestions kini diurutkan berdasarkan frekuensi akses — kolom/tabel yang sering digunakan muncul lebih dulu
  • Completion kolom kini menyarankan tiga bentuk: kolom, tabel.kolom, dan alias.kolom

🐛 Bug Fixes

  • Completion kolom kini muncul setelah SELECT meski belum ada klausa FROM

🔧 Internal Refactors

  • SQL parsing diganti dengan crate sqlparser — lebih robust untuk query kompleks
  • Alias & tokenizer dipindah ke core/query (keluar dari repl adapter)
  • CompletionService dipecah menjadi query dan command concerns
  • ID koneksi diganti dari UUID ke SQLite autoincrement
  • Repl struct dan CommandHandler diperkenalkan untuk konsistensi dengan pola CLI
  • CLI dipecah per handler, ConnectionSvc trait diinjeksi ke Cli
  • Berbagai service refactor untuk konsistensi trait (AnalyticsSvc, SchemaSvc)

Full Changelog: v0.5.0...v0.6.0

v0.5.0

Choose a tag to compare

@fakhrulnugroho fakhrulnugroho released this 26 May 05:16

What's Changed

🚀 New Features

  • \export command: export hasil query ke file CSV dari dalam REPL, dengan dukungan quoted paths dan tilde expansion (~/file.csv)
  • SQLite backend: koneksi kini disimpan di ~/.pgrs/pgrs.db (SQLite), menggantikan connections.json
  • Analytics: \history menampilkan riwayat query dengan ID dan timestamp lokal; \stats menampilkan tabel dan query yang paling sering digunakan
  • Schema caching: skema tabel/kolom di-cache di SQLite untuk performa tab-completion yang lebih cepat
  • DomainError enum: error handling end-to-end diganti dari String ke typed enum DomainError
  • UUID v4 sebagai generator ID koneksi (menggantikan DefaultHasher)

🐛 Bug Fixes

  • \export: blokir DDL dalam export, cleanup file parsial jika write gagal
  • \export: tampilkan usage jika diketik tanpa argumen
  • CSV quoting: handle \r dengan benar
  • SQLite: tambahkan ROLLBACK pada error save_schema, transaction di record_query
  • Install script: deteksi OS dan arsitektur dengan benar untuk binary yang sesuai
  • UUID: ganti DefaultHasher dengan UUID v4 untuk ID yang lebih aman

♻️ Refactors

  • Pemisahan arsitektur heksagonal: repository, service, dan port traits dipecah ke modul yang lebih fokus (analytics, schema, connection)
  • REPL commands dipecah ke modul terpisah (commands.rs, ui.rs, csv.rs, sql_utils.rs)

Full Changelog: v0.4.1...v0.5.0

v0.4.1

Choose a tag to compare

@fakhrulnugroho fakhrulnugroho released this 24 May 04:20

What's Changed

🐛 Bug Fixes

  • Replace /dev/urandom with cross-platform ID generation for Windows compatibility
  • Gate Unix-only APIs behind #[cfg(unix)] to fix Windows builds

🔧 CI / Maintenance

  • Vendor OpenSSL to fix builds on Linux runners
  • Expand CI matrix to multi-platform builds (Linux, macOS, Windows)
  • Remove needless return statement flagged by clippy

Full Changelog: v0.4.0...v0.4.1

v0.4.0

Choose a tag to compare

@fakhrulnugroho fakhrulnugroho released this 24 May 03:30

What's Changed

🚀 New Features

Connection IDs

  • Setiap koneksi sekarang mendapat ID hex 8-karakter saat ditambahkan
  • Semua perintah (connect, shell, delete, dll.) kini menerima ID atau nama
  • Kolom ID ditampilkan di output list
  • Alias baru: ls (list), del / rm (delete)

Environment Labels

  • Tambahkan label environment opsional ke koneksi via --env
  • Kolom ENV tampil di list, label muncul di prompt REPL

REPL: Describe Table (\d / \d+)

  • \d <table> menampilkan kolom, tipe, nullability, dan default
  • \d+ <table> menampilkan juga indeks, foreign key, check constraint, dan trigger
  • Tab-completion nama tabel setelah \d dan \d+

REPL: List Databases (\l)

  • Perintah \l menampilkan semua database di server

🐛 Bug Fixes

  • Decode karakter percent-encoded di kredensial URL koneksi
  • Pesan error kini menggunakan nama koneksi yang sudah di-resolve (bukan alias)
  • Semicolon di dalam identifier double-quoted tidak lagi mengakhiri statement
  • Tolak nama tabel kosong pada perintah describe

⚙️ Improvements

  • Multi-platform CI release builds dengan version injection
  • Refactor REPL: tokenizer, alias resolver, dan schema port dipisah menjadi modul terstruktur
  • Teks bantuan (--help) distrukturkan sebagai data array untuk kemudahan pemeliharaan

Full Changelog: v0.3.0...v0.4.0

v0.3.0

Choose a tag to compare

@fakhrulnugroho fakhrulnugroho released this 23 May 04:39

What's Changed

🚀 New Features

  • REPL table rendering: minimal style dengan truncation, expanded record view (\x), middle-truncate untuk sel panjang
  • REPL backslash commands: \dt (list tables), \x (toggle expanded), \refresh (reload schema), \q (quit); DDL auto-refresh setelah CREATE/DROP/ALTER
  • Ghost text completion: SqlHinter dengan common-prefix suggestion saat mengetik
  • Context-aware JOIN ON completion: kolom yang ada di kedua tabel diprioritaskan
  • Alias-aware completion: resolusi alias FROM/JOIN/subquery di dot-completion dan column completion
  • CLI UX improvements: perbaikan help text, dukungan TLS modes per koneksi, pengalaman REPL/connect yang lebih baik

🐛 Bug Fixes

  • Prefix matching pada SqlHinter untuk ghost text yang akurat
  • Char-safe indexing di hint suffix computation
  • Perbaikan needless borrow dan allocation di completer

♻️ Refactoring

  • Hapus normalize_val yang redundan di expanded renderer

Full Changelog: v0.2.0...v0.3.0

v0.2.2

Choose a tag to compare

@fakhrulnugroho fakhrulnugroho released this 22 May 07:18

Improvements

Autocomplete

  • Tab now accepts the highlighted suggestion when the completion dropdown is open

Colorized Output

  • t and f (PostgreSQL short boolean format) are now recognized and colored the same as true and false

Internals

  • Refactored Postgres query column extraction and REPL for cleaner code structure

v0.2.1

Choose a tag to compare

@fakhrulnugroho fakhrulnugroho released this 22 May 07:13

Improvements

Autocomplete

  • Tab now accepts the highlighted suggestion when the completion dropdown is open

Colorized Output

  • t and f (PostgreSQL short boolean format) are now recognized and colored the same as true and false

Internals

  • Refactored Postgres query column extraction and REPL for cleaner code structure