mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-09-11 02:54:23 +02:00
Ability to list just FTS4 or FTS5 table names
This commit is contained in:
parent
231224ba1a
commit
66fd63b119
8 changed files with 53 additions and 22 deletions
|
|
@ -1,4 +1,4 @@
|
|||
from sqlite_utils import cli
|
||||
from sqlite_utils import cli, Database
|
||||
from click.testing import CliRunner
|
||||
import pytest
|
||||
import sqlite3
|
||||
|
|
@ -23,6 +23,18 @@ def test_table_names(db_path):
|
|||
assert "Gosh\nGosh2" == result.output.strip()
|
||||
|
||||
|
||||
def test_table_names_fts4(db_path):
|
||||
Database(db_path)["Gosh"].enable_fts(["c2"], fts_version="FTS4")
|
||||
result = CliRunner().invoke(cli.cli, ["table_names", "--fts4", db_path])
|
||||
assert "Gosh_fts" == result.output.strip()
|
||||
|
||||
|
||||
def test_table_names_fts5(db_path):
|
||||
Database(db_path)["Gosh"].enable_fts(["c2"], fts_version="FTS5")
|
||||
result = CliRunner().invoke(cli.cli, ["table_names", "--fts5", db_path])
|
||||
assert "Gosh_fts" == result.output.strip()
|
||||
|
||||
|
||||
def test_vacuum(db_path):
|
||||
result = CliRunner().invoke(cli.cli, ["vacuum", db_path])
|
||||
assert 0 == result.exit_code
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue