快轉到主要內容

SQL Console Release v0.3.0

·759 字·2 分鐘·
PolloChang
作者
PolloChang
我是一隻雞
  • GitHub Repository: sql-console
  • Development Guide: Check out DEVELOP.md in the repo root.
  • AI Agent Skill for sql-console: sql-operator

大家好,SQL Console v0.3.0 正式發布啦! 🎉

在這次的改版中,我們特別強化了對於 Oracle 資料庫的支援,並提升了整體的系統安全性:

  1. 新增 Oracle 專屬指令支援:現在可以直接使用 desc 查看資料表結構,以及 show parameter 查詢系統參數,與日常操作習慣無縫接軌!
  2. 嚴格的安全防護:導入了基於白名單的安全驗證機制,能有效攔截非法的輸入(SEC-403),徹底防禦潛在的 SQL Injection 風險,強化終端機環境的資安合規。
  3. 架構重構:全新實作了 Stateless Translator 模式,完全遵循 SOLID (SRP/OCP) 原則,將 SQL 轉譯邏輯與執行邏輯分離,為未來的擴展打下穩固基礎。

這是一個專為需要在 Terminal 下維護多種資料庫 (PostgreSQL, Oracle, MSSQL 等) 的 SRE/DBA 打造的開源工具,透過 JDBC 連線,讓你不用再頻繁切換不同環境!

詳細的發布資訊與教學可以看這裡: https://github.com/PolloChang/sql-console/releases/tag/v0.3.0

歡迎大家下載使用並給予回饋!

v0.3.0
#

  • Feature: Support Oracle Database special commands (show parameter and desc/describe).
  • Security: Implement whitelist validation input regex to defend against SQL Injection in client commands.
  • SOLID: Refactor ClientCommandProcessor to a pure stateless translator pattern and clean up execution engine logic.

新增功能預覽畫面: Oracle Database Special Commands
#

Show Parameters
#

1
testdb> show parameter sga_target;

Output:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
testdb> show parameter sga_target;
sql_id: 8f255f9d , transaction: auto-commit
result fetch size: 20
page: 1/1, total rows: 1
┌────────────┬──────┬────────────┬────────────────────┐
│    NAME    │ TYPE │   VALUE    │    DESCRIPTION     │
├────────────┼──────┼────────────┼────────────────────┤
│ sga_target │ 6    │ 8589934592 │ Target size of SGA │
└────────────┴──────┴────────────┴────────────────────┘

(1 rows affected, 24ms)

DescRIBE command
#

1
testdb> desc dual
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
testdb> desc dual
sql_id: 54e09cab , transaction: auto-commit
result fetch size: 20
page: 1/1, total rows: 1
┌───────┬────────┬─────────────┐
│ NAME  │ NULL ? │    TYPE     │
├───────┼────────┼─────────────┤
│ DUMMY │ NULL   │ VARCHAR2(1) │
└───────┴────────┴─────────────┘

(1 rows affected, 226ms)