sqlfuzz

Crates.iosqlfuzz
lib.rssqlfuzz
version0.3.0
sourcesrc
created_at2022-07-09 20:33:18.93262
updated_at2022-07-10 19:37:32.69507
descriptionGenerate random (and sometimes valid!) queries from any local Parquet, CSV, JSON, or Avro data set.
homepagehttps://github.com/andygrove/sqlfuzz
repositoryhttps://github.com/andygrove/sqlfuzz
max_upload_size
id622749
size92,523
Andy Grove (andygrove)

documentation

README

SQL Fuzz Testing Utilities

Generate random (and sometimes valid!) SQL queries from any local datasets in Parquet, CSV, JSON, or Avro format.

Installation

cargo install sqlfuzz

Query Fuzzing

sqlfuzz query \
  --table ./testdata/test0.parquet ./testdata/test1.parquet \
  --join-type inner left right full semi anti \
  --count 5 \
  --max-depth 5

Example Generated Query

SELECT __c320, __c321, __c322, __c323
FROM (
    (SELECT test1.c0 AS __c320, test1.c1 AS __c321, test1.c2 AS __c322, test1.c3 AS __c323
    FROM (test1))
    INNER JOIN
    (SELECT test1.c0 AS __c324, test1.c1 AS __c325, test1.c2 AS __c326, test1.c3 AS __c327
    FROM (test1))
    ON __c320 = __c327)
WHERE __c323 > __c320;

Data Generator

If you don't already have suitable data, you can generate random data files to run the query fuzzer against.

sqlfuzz data --path ./testdata --num-files 4 --row-count 20
Commit count: 33

cargo fmt