Releases: ZacharyJo/db-cli
Releases · ZacharyJo/db-cli
Release list
v2.2.1
v2.2.1
Added
--version/-vflag: print the binary version (injected at build time via ldflags)
Fixed
- Security: escape SQL identifiers in
--create-dband\cto prevent injection via database names containing special characters (backtick for MySQL wire, double-quote for PostgreSQL wire) - Security: apply
pgxQuotetouseranddbnamefields in PostgreSQL-wire DSN (was previously only applied topassword) - Security: use
url.UserPasswordin MongoDB URI builder to correctly percent-encode credentials with special characters - Security: percent-escape
userandschemafields in Dameng DSN (was previously only applied topassword) - Security: validate
--gaussdb-compatvalue — only alphanumeric characters and underscores are accepted import --stop-on-error: now correctly aborts on statement execution errors; both error branches influshStmtwere previously identical (dead code), causingfatalErrto never be set- REPL: semicolon detection changed from
strings.Containstostrings.HasSuffixto avoid false triggers on semicolons inside string literals (e.g.VALUES('a;b')) - Port defaults for KingbaseDB / GaussDB / Dameng: use cobra
Changed("port")instead of comparing against the MySQL default3306, so explicitly passing-P 3306is now respected - History files unified under
~/.db-cli/with per-type filenames (mysql_history,gaussdb_history,redis_history,mongo_history, etc.) connect,exec,import: replaceos.Exit(1)insideRunEhandlers withreturn errfor correct cobra error propagation and non-zero exit codeimport: suppress cobra usage output on runtime errors (SilenceUsage = true) — avoids printing the help block when--ignore-errorsreports accumulated errors at the end- Table output: datetime values (e.g. Dameng driver returns
time.Time) now render as2006-01-02 15:04:05instead of splitting across multiple rows; embedded CR/LF in cell values normalized to spaces; tablewriter auto word-wrap disabled import --ignore-errorson PostgreSQL-wire (GaussDB / KingbaseDB / openGauss): executeROLLBACKafter each failed statement to reset the aborted-transaction state, preventing cascading errors on subsequent statements