mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-23 01:14:31 +02:00
parent
a8f9cc6f64
commit
539f5ccd90
3 changed files with 17 additions and 0 deletions
|
|
@ -6,6 +6,8 @@
|
|||
|
||||
The ``sqlite-utils`` command-line tool can be used to manipulate SQLite databases in a number of different ways.
|
||||
|
||||
Once installed, the tool should be available as ``sqlite-utils``. It can also be run using ``python -m sqlite_utils``.
|
||||
|
||||
.. contents:: :local:
|
||||
|
||||
.. _cli_query:
|
||||
|
|
|
|||
4
sqlite_utils/__main__.py
Normal file
4
sqlite_utils/__main__.py
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
from .cli import cli
|
||||
|
||||
if __name__ == "__main__":
|
||||
cli()
|
||||
|
|
@ -1,6 +1,8 @@
|
|||
from sqlite_utils import cli, Database
|
||||
from sqlite_utils.db import Index, ForeignKey
|
||||
from click.testing import CliRunner
|
||||
import subprocess
|
||||
import sys
|
||||
from unittest import mock
|
||||
import json
|
||||
import os
|
||||
|
|
@ -2017,3 +2019,12 @@ def test_integer_overflow_error(tmpdir):
|
|||
"sql = INSERT INTO [items] ([bignumber]) VALUES (?);\n"
|
||||
"parameters = [34223049823094832094802398430298048240]\n"
|
||||
)
|
||||
|
||||
|
||||
def test_python_dash_m():
|
||||
"Tool can be run using python -m sqlite_utils"
|
||||
result = subprocess.run(
|
||||
[sys.executable, "-m", "sqlite_utils", "--help"], capture_output=True
|
||||
)
|
||||
assert result.returncode == 0
|
||||
assert b"Commands for interacting with a SQLite database" in result.stdout
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue