Skip to content

Colorize sqlite3 CLI #133447

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

Open
StanFromIreland opened this issue May 5, 2025 · 7 comments
Open

Colorize sqlite3 CLI #133447

StanFromIreland opened this issue May 5, 2025 · 7 comments
Labels
stdlib Python modules in the Lib dir topic-sqlite3 type-feature A feature request or enhancement

Comments

@StanFromIreland
Copy link
Contributor

StanFromIreland commented May 5, 2025

Feature or enhancement

Proposal:

I will open a pr once #133393 is complete.

General idea is to follow repl color scheme:

sqlite>: repl magenta (i.e. >>>)
keywords: repl keyword blue (i.e. def)
.quit/.help: repl turquoise (i.e. exit)
rest: no color

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

Linked PRs

@hugovk
Copy link
Member

hugovk commented May 5, 2025

See also theming support, which will hopefully be merged soon: issue #133346 / PR #133347.

@ambv
Copy link
Contributor

ambv commented May 5, 2025

I like how Stan is already talking in terms of semantic classes.

@picnixz picnixz added stdlib Python modules in the Lib dir topic-sqlite3 labels May 5, 2025
@StanFromIreland
Copy link
Contributor Author

Unfortunately the code currently uses a subclass of InteractiveConsole (color support anytime soon? ;-) so I would have to write a raw_input, but that still has to wait for the other pr ideally.

For now I will open a pr adding color to the line starts as it is not depending on the pr. (Progressing like pyrepl coloring...)

@StanFromIreland
Copy link
Contributor Author

This is not in the sqlite3 project.

cc @ezio-melotti Can the project be set up to add them when the label is used topic-sqlite3, it would be a good test for the github workflow-like automations for projects that we discussed earlier?

@ezio-melotti
Copy link
Member

ezio-melotti commented May 10, 2025

Done!

Details I enabled the auto-add workflow:

Image

which matches 7 issues -- including this one -- but doesn't add them unless they are updated or newly created:

Image

Note: after enabling the workflow and posting this message, the issue wasn't added to the workflow, so I added it manually. The GitHub docs are not clear on what "updated" means (apparently posting a message doesn't count as an update).

Note: I initially added in:title to the auto-add workflow query, but I got an error stating that it's invalid. Even after removing it, the query matches 7 issues, even though when I follow the "See 7 existing issues" link I get 50 issues. I now reported this issue to GitHub.

@StanFromIreland
Copy link
Contributor Author

StanFromIreland commented May 10, 2025

posting this message, the issue wasn't added to the workflow

That is odd, maybe it only checks on title modifications?

I initially added in:title to the auto-add workflow query, but I got an error stating that it's invalid.

We could add on the label addition instead like other projects.

@ezio-melotti
Copy link
Member

We could add on the label addition instead like other projects.

Done, and it seems it work on label addition (tested on #129926).

Image

tanloong pushed a commit to tanloong/cpython that referenced this issue May 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir topic-sqlite3 type-feature A feature request or enhancement
Projects
Status: In Progress
Development

No branches or pull requests

5 participants