kvokka/pp_sql
Rails ActiveRecord SQL queries log beautifier
✨ Định dạng SQL đẹp trong Rails log và console
Thay thế
ActiveRecord#to_sqlbằnganbt-sql-formatter, hiển thị SQL đẹp trong console và log.
PpSql là gem Ruby dùng anbt-sql-formatter để làm đẹp câu lệnh SQL từ ActiveRecord. Hỗ trợ Rails 7.1+ (tùy chọn), tự động chèn vào Rails. Yêu cầu Ruby 3.1+.
✨ Điểm nổi bật
- to_sql được định dạng: Thay thế
ActiveRecord#to_sqlbằng output đẹp. - Rails log đẹp: Định dạng SQL trong Rails log tự động.
- Cài đặt dễ dàng: Thêm
gem 'pp_sql', group: :developmentvào Gemfile. - Tùy chỉnh hành vi:
PpSql.rewrite_to_sql_method=falseđể giữto_sqlgốc. - Tắt log formatting:
PpSql.add_rails_logger_formatting=false. - Hỗ trợ pry/formatter khác: Dùng
putshoặcpp_sql. - Thêm vào ApplicationRecord:
include PpSql::ToSqlBeautify if defined?(Rails::Console). - Hỗ trợ Rails 7.1–8.1, Ruby 3.2–3.4.
💡 Vì sao đáng chú ý
PpSql tập trung vào một bài toán cụ thể: làm đẹp SQL. Không phải ORM mới, không phải query builder — chỉ là wrapper nhẹ quanh anbt-sql-formatter. Phù hợp nhóm phát triển Rails muốn log/console SQL dễ đọc mà không thay đổi workflow.
#Ruby #Rails #SQL #Formatter #OpenSource #TiniX
Dự án tương tự
Khám phá các dự án và mô hình AI khác có sự tương đồng.
A shell parser, formatter, and interpreter with bash and zsh support; includes shfmt
Perl script to add indentation (leading horizontal space) to LaTeX files. It can modify line breaks before, during and after code blocks; it can perform text wrapping and paragraph line break removal. It can also perform string-based and regex-based substitutions/replacements. The script is customisable through its YAML interface.
One Beautifier to rule them all, One Beautifier to clean them, One Beautifier to bring them all and in the darkness sheen them
🧜♀️ A Sublime Text plugin to beautify, minify, convert: CSS, SCSS, Sass, HTML, XML, SVG, JS,JavaScript, JSON, GraphQL, Markdown, TypeScript, Vue, Lua, YAML, Go, Perl, PHP, Python, Ruby, Rust, Haskell, Dart, Swift, Crystal, Bash, Shell, SQL, CSV, C, C++, C#, Objective-C, D, Java, Pawn, Julia, Blade, LaTeX, D2, Graphviz, Mermaid, PlantUML, Disasm..
An easy-to-use set of config files to beautify Git in your MacOS or OS X terminal. If you find it hard to parse a jumble of mono-colored type on your command line, this set-up can help you tame the ugly bash beast.
Alist/OpenList 动态美化方案 | Alist/OpenList Dynamic Beautification Solution
Reverse engineer anything with agents, from app behavior down to native binaries.