Skip to main content

Scan directories for SQLite databases

Project description

sqlite-scanner

sqlite-scanner is a tiny Go CLI that recurses through one or more directories, checks each regular file’s header bytes, and reports the ones whose first 16 bytes match SQLite format 3\x00. It never trusts file extensions, and it can run multiple workers in parallel for speed.

Features

  • scans one or more positional paths or falls back to . when no paths are specified
  • configurable worker pool via --workers (defaults to your CPU count)
  • always prints absolute paths so results are unambiguous
  • optional --size flag that appends file sizes to text output and emits JSON objects like {"path": "...", "size": ...}
  • newline-delimited JSON via --jsonl; use --size to include each object's size field
  • JSON output mode (--json) that pretty-prints {"entries": [...]} objects for downstream processing
  • streams matches immediately as they’re discovered (plain text and pretty JSON)
  • custom --help text that describes usage, examples, and notes

Setup

git clone https://github.com/simonw/sqlite-scanner
cd sqlite-scanner

Build

go build -o bin/sqlite-scanner

Usage

Simple scan (current directory):

bin/sqlite-scanner

Scan /tmp and $HOME:

bin/sqlite-scanner /tmp ~

Use JSON mode:

bin/sqlite-scanner /tmp --json

Example JSON output shape:

{
  "entries": [
    {"path": "/abs/path/to/db1.sqlite"},
    {"path": "/abs/path/to/db2.sqlite"}
  ]
}

Use newline-delimited JSON to stream objects per line (requires --size to include size):

bin/sqlite-scanner --jsonl ~/dev

Example JSONL output shape (no size):

{"path": "/abs/path/to/db1.sqlite"}
{"path": "/abs/path/to/db2.sqlite"}

Example JSONL output shape (with --size):

{"path": "/abs/path/to/db1.sqlite", "size": 12345}
{"path": "/abs/path/to/db2.sqlite", "size": 67890}

Include sizes (plain text shows (size bytes) and JSON outputs objects) with:

bin/sqlite-scanner --size /tmp --json

Example --size output (plain text):

/abs/path/to/db1.sqlite (12345 bytes)
/abs/path/to/db2.sqlite (67890 bytes)

Check available flags (it prints the detailed help text added earlier; all flags use the --flag form):

bin/sqlite-scanner --help

Testing

go test

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

sqlite_scanner-0.1.1-py3-none-win_arm64.whl (2.2 MB view details)

Uploaded Python 3Windows ARM64

sqlite_scanner-0.1.1-py3-none-win_amd64.whl (2.2 MB view details)

Uploaded Python 3Windows x86-64

sqlite_scanner-0.1.1-py3-none-musllinux_1_2_x86_64.whl (2.1 MB view details)

Uploaded Python 3musllinux: musl 1.2+ x86-64

sqlite_scanner-0.1.1-py3-none-musllinux_1_2_aarch64.whl (2.1 MB view details)

Uploaded Python 3musllinux: musl 1.2+ ARM64

sqlite_scanner-0.1.1-py3-none-manylinux_2_17_x86_64.whl (2.1 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

sqlite_scanner-0.1.1-py3-none-manylinux_2_17_aarch64.whl (2.1 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

sqlite_scanner-0.1.1-py3-none-macosx_11_0_arm64.whl (2.1 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

sqlite_scanner-0.1.1-py3-none-macosx_10_9_x86_64.whl (2.2 MB view details)

Uploaded Python 3macOS 10.9+ x86-64

File details

Details for the file sqlite_scanner-0.1.1-py3-none-win_arm64.whl.

File metadata

File hashes

Hashes for sqlite_scanner-0.1.1-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 7bae87b45eb8b148eb4b6fd739b9e771ca833dfeb6391b01ec3c7fe77364ece5
MD5 5f6a563509530d3b021d6596b62f3872
BLAKE2b-256 a391b2d77b4c467b649bad2696cdcf4f77fe4d053113fda1660af0299ab1661a

See more details on using hashes here.

File details

Details for the file sqlite_scanner-0.1.1-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for sqlite_scanner-0.1.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 4b0e945ea5b71270c569df3bff4d61aea4828a071dce114faa82e70649ab7504
MD5 82cf2f6bdf96cdf88bff66a4d196a507
BLAKE2b-256 2a579b607803157005cbc4e679c3ef98476346355faff2630756f684169937a3

See more details on using hashes here.

File details

Details for the file sqlite_scanner-0.1.1-py3-none-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for sqlite_scanner-0.1.1-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 41d42411208cb1331b40b236993856f02a5c103e563e9e0a781c9c230765ae7f
MD5 3e784eb30f6da90690d8e816b67db2b0
BLAKE2b-256 03241546aad9e9ddc49fc649711206177787b0fb96992420432bcd4e2e3bcd48

See more details on using hashes here.

File details

Details for the file sqlite_scanner-0.1.1-py3-none-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for sqlite_scanner-0.1.1-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 d72673df796634591b23d248b6cdee2779517dd2c8ae8c074a54b911b1a4f605
MD5 9f3609580e60ff8bae1d93f0367dd9c2
BLAKE2b-256 2bfde82cbc8607bfd62c154e4902d4e2bd17a5be6f244289bbddb6719f94ea77

See more details on using hashes here.

File details

Details for the file sqlite_scanner-0.1.1-py3-none-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for sqlite_scanner-0.1.1-py3-none-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 6f9c543d3aa9091806e63237b75cad846a55fc46589c19fb860ea4c5c0c98160
MD5 7ae57a8e5c94743eb1990a650c7ed759
BLAKE2b-256 7c86fa000bbd7278ae2cc536c8e64ac15b828397f7152eeadb40561760c37f14

See more details on using hashes here.

File details

Details for the file sqlite_scanner-0.1.1-py3-none-manylinux_2_17_aarch64.whl.

File metadata

File hashes

Hashes for sqlite_scanner-0.1.1-py3-none-manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 c972fe8c3ef9325bf1b6aa61cc60391ba600fdfce5e8096f7b6b2aebdf13193e
MD5 2b99512542ab6d45eaedfbe344bb2fd6
BLAKE2b-256 6f1d2ec490677b4967acc413ee2eb53c213cdf323a0ec97ee0b76860134f5a88

See more details on using hashes here.

File details

Details for the file sqlite_scanner-0.1.1-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for sqlite_scanner-0.1.1-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4625b69c4abd5176a29e0072d46390b3d7403ff0931e5e37923bc7d2d8d361c8
MD5 813770f12fd9d894357ca8d586c4098e
BLAKE2b-256 88b117a716635d2733fec53ba0a8267f85bd6b6cf882c6b29301bc711fba212c

See more details on using hashes here.

File details

Details for the file sqlite_scanner-0.1.1-py3-none-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for sqlite_scanner-0.1.1-py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 04f1cead81616dbd2b320cd266935993eca24c0585d93032c2e8e960ab944b78
MD5 88681f2289c354d78ba30cfe73304f46
BLAKE2b-256 2b545eef290f2c11dbb319c4f3b53965c0f71716a47426689b0b505cbc0ad17a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page