Simple SQL table fuzzing

Overview

SQLfuzz

Go Report Card GoDoc License made-with-Go sqlfuzz test workflow

Load random data into SQL tables for testing purposes. The tool can get the layout of the SQL table and fill it up with random data.

Installation

MacOS

wget https://github.com/PumpkinSeed/sqlfuzz/releases/download/{RELEASE}/sqlfuzz_darwin_amd64 -O /usr/local/bin/sqlfuzz
chmod +x /usr/local/bin/sqlfuzz

Linux

# amd64 build
wget https://github.com/PumpkinSeed/sqlfuzz/releases/download/{RELEASE}/sqlfuzz_linux_amd64 -O /usr/local/bin/sqlfuzz
chmod +x /usr/local/bin/sqlfuzz

# arm64 build
wget https://github.com/PumpkinSeed/sqlfuzz/releases/download/{RELEASE}/sqlfuzz_linux_arm64 -O /usr/local/bin/sqlfuzz
chmod +x /usr/local/bin/sqlfuzz

Windows

You can download the Windows build here

Build from source

wget https://github.com/PumpkinSeed/sqlfuzz/archive/{RELEASE}.zip
# unzip
# cd into dir
go install main.go

Usage

# MySQL
sqlfuzz -u username -p password -d database -h 127.0.0.1 -t table -n 100000 -w 100

# Postgres
sqlfuzz -u username -p password -d database -h 127.0.0.1 -t table -n 100000 -w 100 -P 5432 -D postgres

Flags

  • u: User for database connection
  • p: Password for database connection
  • d: Database name for database connection
  • h: Host for database connection
  • P: Port for database connection
  • D: Driver for database connection (supported: mysql, postgres)
  • t: Table for fuzzing
  • n: Number of rows to fuzz
  • w: Concurrent workers to work on fuzzing
  • s: Seed value for reproducibility of data

Package usage

TODO: Write package

Comments
  • Add seed as CLA for reproducible fuzzing

    Add seed as CLA for reproducible fuzzing

    Fixes #18 The seed variable can be passed as a command line argument, if it is not passed the default behavior is to set the seed as 0 which will also maintain backward compatibility.

    hacktoberfest hacktoberfest-accepted 
    opened by kinshukdua 3
  • Foreign key constrains and multiple table options

    Foreign key constrains and multiple table options

    Feature request from reddit:

    Does it support and understand constraints when given multiple tables? And does it handle FK? Eg; If my T2 has a FK to T1 and i fuzz them in the correct order will the tool figure it out?

    So make the tool understand constrains even if the one table passed and add the feature to handle more tables with comma separated.

    enhancement help wanted good first issue 
    opened by PumpkinSeed 2
  • MySQL advanced describe

    MySQL advanced describe

    Currently the MySQL driver reads the table details with the DESCRIBE SQL command. It would be much cleaner if it would use the information_schema.tables just like the Postgres driver does.

    enhancement good first issue hacktoberfest hacktoberfest-accepted 
    opened by PumpkinSeed 1
  • Reproducible fuzzing

    Reproducible fuzzing

    Feature idea from reddit:

    Is it possible to set a random seed to get reproducible random data? This would be useful for unit testing to get the same data on each run.

    So the main goal of the ticket is make it possible to reproduce certain fuzzing scenarios for unit-tests. This can be done by the change of the seeding mechanism.

    enhancement good first issue hacktoberfest 
    opened by PumpkinSeed 0
  • Upgrade CodeSee workflow to version 2

    Upgrade CodeSee workflow to version 2

    CodeSee is a code visibility platform.

    This change updates the CodeSee workflow file to the latest version for security, maintenance, and support improvements (see changelog below).

    That workflow file:

    • runs CodeSee's code analysis on every PR push and merge
    • uploads that analysis to CodeSee.
    • It does not transmit your code.

    The code analysis is used to generate maps and insights about this codebase.

    CodeSee workflow changelog:

    • Improved security: Updates permission to be read-only.
    • Improved future maintenance: Replaces the body of the workflow with a single github action: codesee-action. This makes it significantly easier for CodeSee to introduce future improvements and fixes without requiring another PR like this.
    • Improved Python support: The action now properly supports Python 3.11, and will continue to support new Python versions as they are released.
    opened by codesee-maps[bot] 1
  • MySQL: Not respecting AUTO_INCREMENT when inserting new records

    MySQL: Not respecting AUTO_INCREMENT when inserting new records

    sqlfuzz expects a table to be completely clean, so if a table already contains some data it then fails:

    2021/04/24 15:08:26 Error 1062: Duplicate entry '1' for key 'PRIMARY'
    

    In my case, i can't have a completely empty table/database due to various constrains, but I do want to add e.g. 100k new records.

    SHOW CREATE TABLE table spits out AUTO_INCREMENT=XX so XX should be the starting point instead of 1.

    bug help wanted hacktoberfest 
    opened by maksimovic 1
  • MySQL: Tables having FK references can't be populated because sqlfuzz doesn't go and populate the

    MySQL: Tables having FK references can't be populated because sqlfuzz doesn't go and populate the "parent" table first

    Getting an error like

    2021/04/24 14:58:51 Error 1452: Cannot add or update a child row: a foreign key constraint fails (`db`.`table`, CONSTRAINT `FK_something` FOREIGN KEY (`column_from_table`) REFERENCES `other_table` (`id`) ON DELETE CASCADE ON UPDATE CASCADE)
    
    bug help wanted hacktoberfest 
    opened by maksimovic 0
  • MYSQL: Issue recognizing FLOAT / DECIMAL column type

    MYSQL: Issue recognizing FLOAT / DECIMAL column type

    sqlfuzz complains with unknown field type when it stumbles upon a column defined as FLOAT which doesn't have explicit length defined.

    I also suspect that it has problems when it's actually defined. For example, I get this error on a table having DECIMAL(25,6):

    panic: strconv.Atoi: parsing "6unsigned": invalid syntax
    
    goroutine 25 [running]:
    github.com/PumpkinSeed/sqlfuzz/drivers.length(0xc000144e60, 0x16, 0x13b1150, 0x7, 0xc00012d15a, 0x1, 0x1)
    	/Users/loow/gopath/src/github.com/PumpkinSeed/sqlfuzz/drivers/helpers.go:24 +0x4b7
    github.com/PumpkinSeed/sqlfuzz/drivers.MySQL.MapField(0x7ffeefbffaa3, 0x8, 0x7ffeefbffaaf, 0x6, 0x7ffeefbffab9, 0x15, 0x7ffeefbffad2, 0x9, 0x7ffeefbffadf, 0x4, ...)
    	/Users/loow/gopath/src/github.com/PumpkinSeed/sqlfuzz/drivers/mysql.go:128 +0x9d3
    github.com/PumpkinSeed/sqlfuzz/pkg/action.generateData(0x1457160, 0xc00012b620, 0xc000144e40, 0x15, 0xc000144e60, 0x16, 0xc00012ce79, 0x3, 0x0, 0x0, ...)
    	/Users/loow/gopath/src/github.com/PumpkinSeed/sqlfuzz/pkg/action/action.go:117 +0x79
    github.com/PumpkinSeed/sqlfuzz/pkg/action.SQLInsertInput.singleInsert(0xc0001548c0, 0x0, 0x13aac01, 0x101)
    	/Users/loow/gopath/src/github.com/PumpkinSeed/sqlfuzz/pkg/action/action.go:107 +0x338
    github.com/PumpkinSeed/sqlfuzz/pkg/action.SQLInsertInput.Insert(0xc0001548c0, 0x0, 0x7ffeefbffa01, 0x8)
    	/Users/loow/gopath/src/github.com/PumpkinSeed/sqlfuzz/pkg/action/action.go:42 +0xb8
    github.com/PumpkinSeed/sqlfuzz/pkg/fuzzer.worker(0xc0001025a0, 0xc00012d130, 0x7ffeefbffaa3, 0x8, 0x7ffeefbffaaf, 0x6, 0x7ffeefbffab9, 0x15, 0x7ffeefbffad2, 0x9, ...)
    	/Users/loow/gopath/src/github.com/PumpkinSeed/sqlfuzz/pkg/fuzzer/runner.go:50 +0x145
    created by github.com/PumpkinSeed/sqlfuzz/pkg/fuzzer.runHelper
    	/Users/loow/gopath/src/github.com/PumpkinSeed/sqlfuzz/pkg/fuzzer/runner.go:28 +0x138
    
    bug help wanted hacktoberfest 
    opened by maksimovic 0
Owner
Ferenc Fabian
Gopher, Rustacean, Hobby Hacker
Ferenc Fabian
A complete grocery store developed with Flutter, .Net Core, Firebase, One Signal and SQL Server as backend

# Grocery-Store developed in Flutter,DotNet Core, Firebase, One-Signal, SQL-Server, Stripe, Razorpay, Paypal A complete grocery store developed with F

Sunil Vijayan 31 Jan 1, 2023
Flutter + Bloc + Laravel Sunctum + SQL Server Job Finder App

Intro Job Finder App on Flutter. Front-end: Flutter State Management: Bloc / Cubit Back-end: Laravel + SQL server to Build Rest Api Check the screensh

Ihab Zaidi 8 Oct 31, 2022
A Flutter widget to create an iOS settings-table (static TableView).

flutter_cupertino_settings A Flutter widget to create an iOS settings-table (static TableView). import 'package:flutter_cupertino_settings/flutter_cup

Matthias Rupp 234 Dec 28, 2022
A Simple Todo app design in Flutter to keep track of your task on daily basis. Its build on BLoC Pattern. You can add a project, labels, and due-date to your task also you can sort your task on the basis of project, label, and dates

WhatTodo Life can feel overwhelming. But it doesn’t have to. A Simple To-do app design in flutter to keep track of your task on daily basis. You can a

Burhanuddin Rashid 1k Jan 6, 2023
Simple yet powerful, open-source SpaceX launch tracker.

SpaceX GO! Simple yet powerful, open-source SpaceX launch tracker About the project The purpose of this project is to develop the ultimate SpaceX expe

Jesús Rodríguez 782 Dec 24, 2022
A simple Pomodoro App.

flutter_pomodoro_timer This App follows the design by Matheus Gois on Dribble (it doesn't mean this project will be such a clone, it's just based ?? )

Lucas S Nogueira 60 Dec 29, 2022
A simple Flutter Note Taking app with local database.

Flutter Simple & Lightweight Note App Flutter Simple & Lightweight Note App UI/UX Credit: https://dribbble.com/shots/11875872-A-simple-and-lightweight

Ahmad Amin 63 Nov 10, 2022
Simple markdown editor. with custom keyboard helper for making bold, italic, list, URL, photoURL, etc

Flutter Markdown Editor A simple markdown creator/editor application, developer with flutter. special auxiliary keyboard features (for develop markdow

Ismael Shakverdiev 36 Dec 15, 2022
A simple, cross-platform password manager created with Flutter.

PassMan PassMan Logo © 2021 by Yash Ahir is licensed under CC BY-NC 4.0 A simple, cross-platform password manager created with Flutter. How to run thi

Yash Ahir 19 Dec 14, 2022
Simple manga reader app for MangaSee, built with Flutter

MAPI Simple manga reader app for MangaSee. Mind that this is my very first attempt on using Flutter. Why I wanted to try out Flutter, and i needed an

Simone 17 Nov 21, 2022
A simple and easy to use Redis client for Dart

redis_dart A simple and minimalist Redis client for Dart See it in pub: https://pub.dev/packages/redis_dart and GitHub: https://github.com/gabrielpach

Gabriel Pacheco 7 Dec 25, 2022
Weather app A complete simple weather application.

Weather app A complete simple weather application. Getting Started Get your own API key from: open weathe map aqicn Google Cloud Platform Setup for go

Yoad 10 Oct 25, 2022
Simple and modern news app that incorporates REST API (newsapi.org), all built entirely with Flutter.

A simple news app with a minimalistic and clean UI that incorporates the newsapi.org api all built entirely with Flutter. Be sure to leave a star ??

Carlton Aikins 73 Dec 1, 2022
Simple student record manager app for learning flutter basics

Simple Student Record Manager Simple student record manager app for learning flutter basics integrated with Django REST API (refer Generic-Student-API

Akshat Soni 3 Oct 31, 2022
A simple app to keep track the time you Learn, Playing, Reading, ... in every week. This is also my attempt to teach myself Flutter & Dart

Progressor 0.0.1 Sometime you want to set a target for you weekly, for example: "Reading Book for 8 hours every week". This app helps you to do that.

Son Nguyen Hoang 4 Oct 12, 2022
Simple, pretty and powerful logger for flutter

Language: English | 中文简体 flutter_logger Simple, pretty and powerful logger for flutter,It has the log level, file name and line number, and can custom

聂志洋 35 Sep 23, 2022
A super simple l10n tool with auto translations via GoogleSheet.

Flutter Translation Sheet Generator [fts] Command line application to make your l10n super fast. Compose your strings in yaml/json format and use Goog

Roi Peker 33 Oct 24, 2022
A simple easy to use Flutter DApp , which keeps a track of all your day to day transactions by using Ethereum blockchain in the background which in turn increases your credit score.

Sahayog A simple easy to use Flutter DApp , which keeps a track of all your day to day transactions by using Ethereum blockchain in the background whi

Utkarsh Agarwal 15 May 21, 2022
Server that provide API to simple note application

note-app-api-mobile end-to-end note application API Golang for the web application MongoDB for the database PostMan requests Collection Flutter simple

Kareem ahmad 6 Oct 4, 2022