Context
duckdb read_csv("logs/*.csv") treats multiple files matching a glob as a single logical table. sql-pipe today requires cat *.csv | sql-pipe for the same result. A glob flag eliminates the extra cat step and handles file discovery natively.
Proposed behavior
# All .csv files in a directory become one table "data"
sql-pipe "SELECT COUNT(*) FROM data" data/*.csv
# Mixed formats with -I override
sql-pipe -I ndjson "SELECT * FROM events" events/*.ndjson
Scope (v1)
- Use
std.fs.openDirAbsolute + walk to resolve glob pattern into file list
- Concat file contents in-memory or stream sequentially into same table
- Validate that all files share the same header/columns
- Table named after the directory basename (e.g.
data/*.csv → table data)
- Fatal error if any file has a different schema
Excluded (YAGNI)
- Merging files with divergent schemas (add missing columns, null-fill)
- Recursive glob (
**/*.csv)
- Multiple glob patterns on the same command line
- File ordering control (sorted alphabetically by default)
- Union-all instead of append semantics
Files affected
src/args.zig — detect glob characters (*, ?, [) in file paths, expand via filesystem walk
src/loader.zig or new src/glob.zig — column validation across files, sequential loading
src/main.zig — wire glob expansion into the existing per-file loading loop
Acceptance criteria
Context
duckdb
read_csv("logs/*.csv")treats multiple files matching a glob as a single logical table. sql-pipe today requirescat *.csv | sql-pipefor the same result. A glob flag eliminates the extracatstep and handles file discovery natively.Proposed behavior
Scope (v1)
std.fs.openDirAbsolute+ walk to resolve glob pattern into file listdata/*.csv→ tabledata)Excluded (YAGNI)
**/*.csv)Files affected
src/args.zig— detect glob characters (*,?,[) in file paths, expand via filesystem walksrc/loader.zigor newsrc/glob.zig— column validation across files, sequential loadingsrc/main.zig— wire glob expansion into the existing per-file loading loopAcceptance criteria
sql-pipe "SELECT * FROM t" fixtures/*.csvloads all matching files into one table