- Accurate Query Execution Feedback
- Distinguishes between successful execution, warnings, and errors
- Removes misleading “no flags” messages from v1.0
- Centralized Runtime Directory
- All pydbms-generated files now live in a dedicated OS-specific
pydbms/directory - Cleaner filesystem usage and future-proof persistence
- All pydbms-generated files now live in a dedicated OS-specific
- Config System (v2 foundation)
- Introduces a persistent
config.json - Enables user-controlled behavior such as banner visibility (introduced as a concept, not utilized in v2.0)
- Introduces a persistent
#NOTE: v2.1.0 had a bug while uploading to PyPI, hence version naming v2.1.5 has been taken for stable release.
Complete JSON Configuration System
- Fully implemented persistent
config.json, stored in the OS-appropriatepydbms/directory on first run. - Configuration now persists across sessions and restores automatically if missing or corrupted.
- Introduced a structured, nested configuration layout for:
- UI settings (e.g., banner visibility)
- MySQL connection settings
- Added interactive inspection of configuration via the
.configmeta-command. - Startup banner behavior is now fully controlled through configuration.
Interactive Configuration Management
- Added
.config set <section>.<key> <value>for modifying configuration values at runtime. - Added
.config reset <section>.<key>to restore individual settings to their default values. - Configuration changes are validated and written to disk immediately.
Session-Level Configuration System
- Introduced a non-persistent session configuration layer that allows runtime behavior changes without modifying
config.json. - Added
.session-configmeta-command to inspect active session settings. - Added
.session-config set <key> <value>for modifying session-only behavior. - Added
.session-config reset <key>to restore individual session settings to defaults. - Session configuration resets automatically on every new run, ensuring a clean startup state.
Inline Query Output Control
- Added the
--expandhelper flag to allow per-query inline column expansion. - Designed to be non-invasive: does not mutate session or persistent configuration.
Improved CLI Discoverability
- Enhanced
.helpoutput with a dedicated Helper Flags section. - Flags and meta-commands are now clearly separated for improved readability and UX.
- Help table layout refined for consistency and long-term extensibility.
Configuration Reliability Improvements
- Hardened configuration validation to safely recover from invalid or corrupted values.
- Ensured strict separation between:
- Persistent configuration (
config.json) - Session-level configuration
- Query-level overrides
- Persistent configuration (
UI & UX Refinements
- Unified visual theming across panels, tables, and help output for a consistent terminal experience.
- Maintained minimalism while increasing discoverability of advanced features.
Database Connection Architecture (NEW)
- Introduced a modular DB connector architecture to decouple connection logic from the CLI core.
- Added a common connector interface to enable future multi-engine support without refactoring core execution logic.
- MySQL support has been migrated to the new architecture with no change in user-facing behavior.
Query Export System (v3 foundation)
- Introduced a pluggable export system with a dedicated exporter interface.
- Added an export manager to centralize format handling and future extensibility.
- Implemented CSV export support using the new architecture.
- Export operations are non-fatal: invalid formats or misuse do not terminate the CLI session.
Internal Result Abstraction
- Added a structured query result model to clearly separate:
- Query execution
- Result representation
- Output/export concerns
- This abstraction serves as the foundation for future export formats (JSON, etc.).
UI Compatibility Guarantee
- Preserved existing query UX and helper syntax to ensure backward compatibility during architectural migration.
- User-facing behavior remains familiar while internals evolve.
Experimental Notes & Limitations
- Export UX, default filenames, and additional formats are intentionally minimal in this release.
- Profile system integration and JSON export are deferred to v3.1.0 (Stable).
- Internal APIs may change before stabilization.
This release introduces major architectural changes and finalizes the architecture introduced in v3.0.0 and delivers a stable, fully composable query export and output-control system.
- Added JSON export support alongside CSV.
- Enforced strict export syntax:
<query> --export <format> <path?> - Implemented predictable default export behavior:
- Automatic
exports/directory creation - Deterministic filenames with timestamps
- Automatic
- Added support for quoted file paths with spaces (implemented via
shlex). - Hardened error handling:
- Invalid formats
- Incorrect usage
- Empty result sets
- Export failures never terminate the active session.
- Finalized
--expandbehavior with clear precedence rules:- Query-level
--expandoverrides session configuration - Session configuration defines default wrapping behavior
- Query-level
- Ensured
--expandcomposes correctly with--export. - Fixed rendering inconsistencies and eliminated duplicate query execution.
- Improved stability by resolving a function signature mismatch in overflow handling.
- Guaranteed single execution per query, regardless of flag combinations.
- Improved control-flow structure for flag composition.
- Eliminated edge-case crashes related to configuration mapping.
- Standardized export-related success and error messages.
- Improved
.helpdocumentation for helper flags. - Preserved backward compatibility with existing query syntax.
- Strengthened separation between:
- Query execution
- Result rendering
- Export handling
- Reduced coupling between CLI control flow and rendering logic.
- Improved long-term maintainability and extensibility.
- Implemented a mandatory local profiles gate (
profile.json) restricting access to the CLI before logging in topydbmslocal account. - Integrated hardware-grade cryptographic hashing utilizing the
crypto-functionslibrary (which wrapsargon2-cffiinternally) to ensure local passwords are never stored in plaintext. - Added encrypted keystroke masking globally using
pwinputduring login pipelines.
- Introduced live query execution spinners (
console.status) precisely wrapped around MySQL database IO to clearly communicate network activity. - Revamped multi-line SQL formatting to replicate MySQL-standard prompts (
->) upon subsequent line entry. - Improved explicit spacing pacing (newlines) across all
.configerror and success rendering blocks.
- Completely replaced dynamic type-casting inference with a strict, static mathematical parser in
meta_handler.py. ui.max_rowsstrictly enforces positive integer bounds to prevent accidentalNoneTypevalue corruption.export.pathstrictly enforces validos.path.isdirresolutions and traps bad file-like paths safely.- All session configurations mathematically strict-check
booleanmappings.
- Fully integrated automated testing via the
pytestengine. - Wrote extensive unit tests testing config validation, query string semantic parsing, CSV normalization logic, and regex table abstractions.
- Established
tests/directory root and appended testing dependencies topyproject.toml.
This release stabilizes v4.0.0 and delivers two new query-level inline flags, a richer export system, and a codebase-wide UX consistency refactor.
- Added a new
--row-limit <N>inline flag that overrides the persistentui.max_rowsconfig for a single query execution. - Validates that
Nis a positive integer; provides clear error messages on misuse. - Fully composes with
--expandand--export.
- Added a new
--include-queryinline flag that embeds the user's original SQL query in the export file.- CSV: SQL query is prepended as a comment row (
# <query>). - JSON: Output is wrapped in a
{ "query": "<SQL>", "rows": [...] }object.
- CSV: SQL query is prepended as a comment row (
- By default, exports do not include the query — users opt in with
--include-query. - Both CSV and JSON exporters updated to accept and honor the
include_queryparameter.
- Migrated all hardcoded
Print("pydbms error> ...")andPrint("pydbms warning> ...")calls to the centralizedpydbms_error()/pydbms_warning()helpers fromengine_base.py. - Files migrated:
core.py,meta_handler.py,db_manager.py,profile_auth.py. - Fixed a colour bug in
profile_auth.pywhere"pydbms warning> Bye!"was printed in RED instead of YELLOW. - Every error/warning message now follows a uniform
<source> error> <message>format with consistent colour, typing effect, and newline behaviour.
- Added
--row-limit <N>and--include-queryto the Helper Flags table. - Updated
.versionbuild info to reflect Stable release status.
- New
db/db_errors.pymodule: IntroducedDBErrorHandlerparent class andMySQLErrorssubclass for DB-engine-specific error/warning output. Uses classmethods — no instantiation required. - All
Print("mysql error> ...")calls inmysql.py,core.py, andmeta_handler.pymigrated toMySQLErrors.error()for consistent, engine-aware error formatting. ExportManager.export()now acceptsinclude_queryas a keyword argument passed through to format-specific exporters.export_base.pyrefactored to an abstract base class (ABC) with enforcedexport()method signature.db_manager.pynow usespydbms_error()from the centralized engine module instead of directPrint()calls.- Lightweight OOP generalization to prepare for multi-engine support in v5.x (full
EngineBaseintegration deferred).
- Fixed
runtime.pycurrent_datetime()crash: was callingdatetime.datetime.now()butdatetimewas imported as the class (from datetime import datetime), not the module. - Removed dead
config = load_config()line inruntime.pythat was immediately overwritten byload_config_safe().
- Extended
test_query_parse.pywith tests for--row-limitand--include-queryflag parsing. - Extended
test_export_manager.pywith tests forinclude_querybehavior in CSV and JSON exports. - Added comprehensive type hints and docstrings across all modified files.