Metadata-Version: 2.1
Name: db-to-sqlite
Version: 0.1
Summary: CLI tool for exporting tables or queries from any SQL database to a SQLite file
Home-page: https://github.com/simonw/db-to-sqlite
Author: Simon Willison
License: Apache License, Version 2.0
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: End Users/Desktop
Classifier: Topic :: Database
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Description-Content-Type: text/markdown
Requires-Dist: sqlalchemy
Requires-Dist: sqlite-utils
Requires-Dist: click

# db-to-sqlite

CLI tool for exporting tables or queries from any SQL database to a SQLite file.

This is in extremely early stages of development - very much a 0.1.

    Usage: db-to-sqlite [OPTIONS] PATH

      Run a SQL query against any database and save the results to SQLite.

      https://github.com/simonw/db-to-sqlite

    Options:
      --version          Show the version and exit.
      --connection TEXT  SQLAlchemy connection string  [required]
      --sql TEXT         SQL query to run  [required]
      --table TEXT       Name of SQLite table to save the results  [required]
      --pk TEXT          Optional column to use as a primary key
      --help             Show this message and exit.

For example, to save the content of the `blog_entry` table from a PostgreSQL database to a local file called `blog.db` you could do this:

    db-to-sqlite blog.db \
        --connection="postgresql://localhost/myblog" \
        --sql="select * from blog_entry" \
        --table=blog_entry \
        --pk=id



