8000 gh-133447: Add basic color to `sqlite3` CLI by StanFromIreland · Pull Request #133461 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-133447: Add basic color to sqlite3 CLI #133461

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
May 10, 2025
Merged
Prev Previous commit
Next Next commit
Don't skip coloring errors on single-statement execution
  • Loading branch information
ambv committed May 6, 2025
commit a220442e7ed52a38c0a45f97ce61057e2b6946c7
5 changes: 3 additions & 2 deletions Lib/sqlite3/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ def main(*args):
Type ".help" for more information; type ".quit" or {eofkey} to quit.
""").strip()

s = get_theme().syntax
theme = get_theme()
s = theme.syntax

sys.ps1 = f"{s.prompt}sqlite> {s.reset}"
sys.ps2 = f"{s.prompt} ... {s.reset}"
Expand All @@ -122,7 +123,7 @@ def main(*args):
try:
if args.sql:
# SQL statement provided on the command-line; execute it directly.
execute(con, args.sql, suppress_errors=False)
execute(con, args.sql, suppress_errors=False, theme=theme)
else:
# No SQL provided; start the REPL.
console = SqliteInteractiveConsole(con, use_color=True)
Expand Down
Loading
0