BogusSQL 1.0.0

Easily generate SQL INSERT statements for large amount of random test data

Install-Package BogusSQL -Version 1.0.0
dotnet add package BogusSQL --version 1.0.0
<PackageReference Include="BogusSQL" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add BogusSQL --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: BogusSQL, 1.0.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install BogusSQL as a Cake Addin
#addin nuget:?package=BogusSQL&version=1.0.0

// Install BogusSQL as a Cake Tool
#tool nuget:?package=BogusSQL&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

BogusSQL

A C# class library for easily generating SQL INSERT statements for large amount of random test data

Features

  • Create large volumes of data in C#
  • Generate meaningful test data at row level
  • Extremely fast data generation

How to use:

using System.Collections.Generic;
using BogusSQL;

namespace BogusSQLDemo
{
    class Program
    {
        static void Main(string[] args)
        {
            var obj = new SqlGenerator
            {
                TableName = "MyTable",
                RowCount = 7000
            };
            var column1 = new Column
            {
                ColumnDataType = DataType.UNIQUEIDENTIFIER,
                ColumnDataContent = DataContent.GUID,
                ColumnName = "Id"
            };
            var column2 = new Column
            {
                ColumnDataType = DataType.NVARCHAR,
                ColumnDataContent = DataContent.FIRSTNAME,
                ColumnName = "FirstName",
                DefaultValue = "DEVANG"
            };
            var column3 = new Column
            {
                ColumnDataType = DataType.NVARCHAR,
                ColumnDataContent = DataContent.LASTNAME,
                ColumnName = "LastName"
            };
            var column4 = new Column
            {
                ColumnDataType = DataType.DATE,
                ColumnDataContent = DataContent.DATE,
                ColumnName = "Birthday"
            };
            var column5 = new Column
            {
                ColumnDataType = DataType.DATETIME,
                ColumnDataContent = DataContent.DATETIME,
                ColumnName = "Timestamp"
            };
            var column6 = new Column
            {
                ColumnDataType = DataType.NVARCHAR,
                ColumnDataContent = DataContent.COMPANY,
                ColumnName = "Company",
                AllowNull = true
            };
            var column7 = new Column
            {
                ColumnDataType = DataType.NVARCHAR,
                ColumnDataContent = DataContent.USERNAME,
                ColumnName = "Username",
                SetNull = true
            };
            var column8 = new Column
            {
                ColumnDataType = DataType.NVARCHAR,
                ColumnDataContent = DataContent.PHONE,
                ColumnName = "Phone",
                Format = "###-###-####"
            };
            var column9 = new Column
            {
                ColumnDataType = DataType.NVARCHAR,
                ColumnDataContent = DataContent.LATITUDE,
                ColumnName = "Latitude"
            };
            var column10 = new Column
            {
                ColumnDataType = DataType.NVARCHAR,
                ColumnDataContent = DataContent.LONGITUDE,
                ColumnName = "Longitude"
            };
            var column11 = new Column
            {
                ColumnDataType = DataType.NVARCHAR,
                ColumnDataContent = DataContent.STREETADDRESS,
                ColumnName = "Street Address"
            };
            var column12 = new Column
            {
                ColumnDataType = DataType.NVARCHAR,
                ColumnDataContent = DataContent.CITY,
                ColumnName = "City"
            };
            var column13 = new Column
            {
                ColumnDataType = DataType.NVARCHAR,
                ColumnDataContent = DataContent.STATE,
                ColumnName = "State",
                UseAbbreviation = true
            };
            var column14 = new Column
            {
                ColumnDataType = DataType.NVARCHAR,
                ColumnDataContent = DataContent.ZIP,
                ColumnName = "Zip",
                Format = "###"
            };
            var column15 = new Column
            {
                ColumnDataType = DataType.NVARCHAR,
                ColumnDataContent = DataContent.COUNTRY,
                ColumnName = "Country",
                DefaultValue = "US"
            };
            var column16 = new Column
            {
                ColumnDataType = DataType.NVARCHAR,
                ColumnDataContent = DataContent.ALPHANUMERIC,
                ColumnName = "SerialNumber",
                Length = 5,
                UseLettersAndNumbers = true
            };
            var column17 = new Column
            {
                ColumnDataType = DataType.NVARCHAR,
                ColumnDataContent = DataContent.FULLNAME,
                ColumnName = "Manager"
            };
            var column18 = new Column
            {
                ColumnDataType = DataType.NVARCHAR,
                ColumnDataContent = DataContent.WEBSITE,
                ColumnName = "Personal Website"
            };

            var columns = new List<Column>()
            {
                column1,
                column2,
                column3,
                column4,
                column5,
                column6,
                column7,
                column8,
                column9,
                column10,
                column11,
                column12,
                column13,
                column14,
                column15,
                column16,
                column17,
                column18
            };
            
            obj.SetColumns(columns);

            obj.GenerateSqlQuery();            
        }
    }
}

The SQL file containing INSERT statements will be generated on Desktop

BogusSQL

A C# class library for easily generating SQL INSERT statements for large amount of random test data

Features

  • Create large volumes of data in C#
  • Generate meaningful test data at row level
  • Extremely fast data generation

How to use:

using System.Collections.Generic;
using BogusSQL;

namespace BogusSQLDemo
{
    class Program
    {
        static void Main(string[] args)
        {
            var obj = new SqlGenerator
            {
                TableName = "MyTable",
                RowCount = 7000
            };
            var column1 = new Column
            {
                ColumnDataType = DataType.UNIQUEIDENTIFIER,
                ColumnDataContent = DataContent.GUID,
                ColumnName = "Id"
            };
            var column2 = new Column
            {
                ColumnDataType = DataType.NVARCHAR,
                ColumnDataContent = DataContent.FIRSTNAME,
                ColumnName = "FirstName",
                DefaultValue = "DEVANG"
            };
            var column3 = new Column
            {
                ColumnDataType = DataType.NVARCHAR,
                ColumnDataContent = DataContent.LASTNAME,
                ColumnName = "LastName"
            };
            var column4 = new Column
            {
                ColumnDataType = DataType.DATE,
                ColumnDataContent = DataContent.DATE,
                ColumnName = "Birthday"
            };
            var column5 = new Column
            {
                ColumnDataType = DataType.DATETIME,
                ColumnDataContent = DataContent.DATETIME,
                ColumnName = "Timestamp"
            };
            var column6 = new Column
            {
                ColumnDataType = DataType.NVARCHAR,
                ColumnDataContent = DataContent.COMPANY,
                ColumnName = "Company",
                AllowNull = true
            };
            var column7 = new Column
            {
                ColumnDataType = DataType.NVARCHAR,
                ColumnDataContent = DataContent.USERNAME,
                ColumnName = "Username",
                SetNull = true
            };
            var column8 = new Column
            {
                ColumnDataType = DataType.NVARCHAR,
                ColumnDataContent = DataContent.PHONE,
                ColumnName = "Phone",
                Format = "###-###-####"
            };
            var column9 = new Column
            {
                ColumnDataType = DataType.NVARCHAR,
                ColumnDataContent = DataContent.LATITUDE,
                ColumnName = "Latitude"
            };
            var column10 = new Column
            {
                ColumnDataType = DataType.NVARCHAR,
                ColumnDataContent = DataContent.LONGITUDE,
                ColumnName = "Longitude"
            };
            var column11 = new Column
            {
                ColumnDataType = DataType.NVARCHAR,
                ColumnDataContent = DataContent.STREETADDRESS,
                ColumnName = "Street Address"
            };
            var column12 = new Column
            {
                ColumnDataType = DataType.NVARCHAR,
                ColumnDataContent = DataContent.CITY,
                ColumnName = "City"
            };
            var column13 = new Column
            {
                ColumnDataType = DataType.NVARCHAR,
                ColumnDataContent = DataContent.STATE,
                ColumnName = "State",
                UseAbbreviation = true
            };
            var column14 = new Column
            {
                ColumnDataType = DataType.NVARCHAR,
                ColumnDataContent = DataContent.ZIP,
                ColumnName = "Zip",
                Format = "###"
            };
            var column15 = new Column
            {
                ColumnDataType = DataType.NVARCHAR,
                ColumnDataContent = DataContent.COUNTRY,
                ColumnName = "Country",
                DefaultValue = "US"
            };
            var column16 = new Column
            {
                ColumnDataType = DataType.NVARCHAR,
                ColumnDataContent = DataContent.ALPHANUMERIC,
                ColumnName = "SerialNumber",
                Length = 5,
                UseLettersAndNumbers = true
            };
            var column17 = new Column
            {
                ColumnDataType = DataType.NVARCHAR,
                ColumnDataContent = DataContent.FULLNAME,
                ColumnName = "Manager"
            };
            var column18 = new Column
            {
                ColumnDataType = DataType.NVARCHAR,
                ColumnDataContent = DataContent.WEBSITE,
                ColumnName = "Personal Website"
            };

            var columns = new List<Column>()
            {
                column1,
                column2,
                column3,
                column4,
                column5,
                column6,
                column7,
                column8,
                column9,
                column10,
                column11,
                column12,
                column13,
                column14,
                column15,
                column16,
                column17,
                column18
            };
            
            obj.SetColumns(columns);

            obj.GenerateSqlQuery();            
        }
    }
}

The SQL file containing INSERT statements will be generated on Desktop

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.0 772 2/15/2018