Skip to content

Support --indent in the .schema command - #278

Open
sulaimwn wants to merge 1 commit into
dbcli:mainfrom
sulaimwn:fix/schema-indent
Open

sulaimwn wants to merge 1 commit into
dbcli:mainfrom
sulaimwn:fix/schema-indent

Conversation

@sulaimwn

Copy link
Copy Markdown

Description

Fixes #179. .schema runstats --indent used to look for a table literally named runstats --indent and return no rows. The option now works on either side of the table name and on its own for the whole database.

The formatter splits the outer column list in table and index definitions. It keeps quoted text, comments, nested expressions, and partial-index predicates intact.

I verified the installed CLI against a database with a table and index. The standard SQLite and SQLean test runs each passed 233 tests on Python 3.12. Ruff lint and formatting passed with the version pinned by CI. On Python 3.13, ty reports the same five diagnostics on this branch and on upstream main at aa53bb0.

OpenAI Codex prepared the patch and tests.

Checklist

  • I've added this contribution to the CHANGELOG.md file.

Recognize the option before or after the table name. Lay out outer columns and constraints while preserving nested expressions, SQL literals and comments.

Fixes dbcli#179.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--indent with .schema doesnt work

1 participant