S3 File Viewer is a web application designed for efficient browsing and querying of S3 bucket data using SQL. It supports .csv and .txt files, allowing users to inspect data structures, run queries with DuckDB, and navigate through a simple interface. Perfect for those needing quick insights without complex setups.
S3 File Viewer is a powerful web application designed for effortless browsing of Amazon S3 buckets and executing SQL queries on text files. Built using Go, HTMX, the AWS SDK, and DuckDB, this project benefits users who need a straightforward solution for data inspection.
.csv and .txt files exclusively, ensuring streamlined data handling.data view, enabling powerful data analysis.S3 File Viewer enables customization through various environment variables:
| Variable | Default | Description |
|---|---|---|
AWS_REGION | (required) | Specifies the AWS region for S3 access. |
PORT | 8080 | Sets the HTTP listening port. |
MAX_QUERY_ROWS | 1000 | Limits the number of returned rows per SQL query. |
QUERY_TIMEOUT_SEC | 30 | Defines the SQL query timeout period. |
BUCKET_ALLOWLIST | (empty) | Lists allowed bucket names (empty for all). |
RAW_PREVIEW_BYTES | 262144 | Specifies the maximum bytes displayed in raw text preview. |
The application offers a user-friendly interface with the following steps:
Home: Enter the S3 bucket name and an optional prefix to begin browsing.
Browse: Navigate through folders and select .csv or .txt files to view content.
File View: For tabular files, the interface features:
SELECT * FROM data LIMIT 100.For unstructured text files, a raw preview is provided instead of the SQL interface.
S3 File Viewer enforces safety measures during SQL execution:
SELECT queries are permitted.DROP, INSERT, or CREATE are blocked.MAX_QUERY_ROWS limit.The project is well-organized into distinct modules, including:
cmd/server/ HTTP server entrypoint
internal/config/ Environment configuration
internal/s3/ AWS S3 listing and object reads
internal/duckdb/ DuckDB pool, schema, and query execution
internal/files/ Text file detection and reader selection
internal/handlers/ HTTP handlers, templates, and static assets
S3 File Viewer serves as a robust foundation for efficiently browsing and querying files stored in Amazon S3, aiding data professionals in their analysis tasks.
No comments yet.
Sign in to be the first to comment.