Skip to content

More attractive indentation of created FTS table schema #148

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

Closed
simonw opened this issue Sep 7, 2020 · 1 comment
Closed

More attractive indentation of created FTS table schema #148

simonw opened this issue Sep 7, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@simonw
Copy link
Owner

simonw commented Sep 7, 2020

On https://github-to-sqlite.dogsheep.net/github/licenses_fts the create table SQL is displayed as:

CREATE VIRTUAL TABLE [licenses_fts] USING FTS5 (
                [name],
                content=[licenses]
            );

It would be more aesthetically pleasing if it looked like this:

CREATE VIRTUAL TABLE [licenses_fts] USING FTS5 (
    [name],
    content=[licenses]
);
@simonw simonw added the enhancement New feature or request label Sep 7, 2020
@simonw
Copy link
Owner Author

simonw commented Sep 7, 2020

This may be as easy as applying textwrap.dedent() to this:

def enable_fts(
self, columns, fts_version="FTS5", create_triggers=False, tokenize=None
):
"Enables FTS on the specified columns."
sql = """
CREATE VIRTUAL TABLE [{table}_fts] USING {fts_version} (
{columns},{tokenize}
content=[{table}]
);
""".format(

I could apply that to a few other queries in that code as well.

@simonw simonw closed this as completed in 59e3d4d Sep 7, 2020
simonw added a commit that referenced this issue Sep 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant