Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrating Dummy Data Algorithm #37

Merged
merged 6 commits into from
Sep 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
268 changes: 3 additions & 265 deletions backend/dummy_db/dummy_handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ const valuesList = (columns : any, scale : number) => {
const columnTypes = createRecordFunc(columns, scale);
const valuesArray : any = [];
// determine maximum number of records Postgres will allow per insert query - with buffer
let maxRecords : number = 10 //90000 / columns.length;
let maxRecords : number = 20; // columns.length;
let list : string = '';
// create the number of records equal to the scale of the table
for (let i : number = 0; i < scale; i += 1) {
Expand Down Expand Up @@ -354,6 +354,8 @@ const createRecordFunc = (columns : any, scale : number) => {
};


module.exports = createInsertQuery;

/* UNCOMMENT BELOW FOR TESTING OBJECT AND FUNCTION */
// const fromApp = {
// schema : 'schema1',
Expand Down Expand Up @@ -399,267 +401,3 @@ const createRecordFunc = (columns : any, scale : number) => {
// ]
// };
// console.log(createInsertQuery(fromApp));

// MODEL FOR USER INTERFACE
/*
const typeOptions : any = {
dropdown : ['unique', 'random'],
add : (val) => {this.state.dataCategory = val},
unique : {
dropdown : ['string', 'number'],
add : (val) => {
if (val === 'string') this.state.dataType = 'str';
else if (val === 'num') this.state.dataType = 'num';
},
str : [
{
display : true,
option : 'Minimum Length',
type : 'textbox',
add : (val) => {this.state.data.length[0] = val},
},
{
display : true,
option : 'Maximum Length',
type : 'textbox',
add : (val) => {this.state.data.length[1] = val},
},
{
display : true,
option : 'Include lower case letters',
type : 'checkbox',
add : (val) => {this.state.data.inclAlphaLow = val},
},
{
display : true,
option : 'Include upper case letters',
type : 'checkbox',
add : (val) => {this.state.data.inclAlphaUp = val},
},
{
display : true,
option : 'Include numbers',
type : 'checkbox',
add : (val) => {this.state.data.inclNum = val},
},
{
display : true,
option : 'Include spaces',
type : 'checkbox',
add : (val) => {this.state.data.inclSpaces = val},
},
{
display : true,
option : 'Include special characters',
type : 'checkbox',
add : (val) => {this.state.data.inclSpecChar = val},
},
{
display : true,
option : 'Include these values (separate by commas)',
type : 'textbox',
add : (val) => {this.state.data.include = val},
},
],
num : [
{
display : false,
option : 'Serial',
type : 'checkbox',
add : (val) => {this.state.data.serial = val},
},
],
},
random : {
dropdown : [
'Address - zipCode',
'Address - zipCodeByState',
'Address - city',
'Address - cityPrefix',
'Address - citySuffix',
'Address - streetName',
'Address - streetAddress',
'Address - streetSuffix',
'Address - streetPrefix',
'Address - secondaryAddress',
'Address - county',
'Address - country',
'Address - countryCode',
'Address - state',
'Address - stateAbbr',
'Address - latitude',
'Address - longitude',
'Address - direction',
'Address - cardinalDirection',
'Address - ordinalDirection',
'Address - nearbyGPSCoordinate',
'Address - timeZone',
'Commerce - color',
'Commerce - department',
'Commerce - productName',
'Commerce - price',
'Commerce - productAdjective',
'Commerce - productMaterial',
'Commerce - product',
'Commerce - productDescription',
'Company - suffixes',
'Company - companyName',
'Company - companySuffix',
'Company - catchPhrase',
'Company - bs',
'Company - catchPhraseAdjective',
'Company - catchPhraseDescriptor',
'Company - catchPhraseNoun',
'Company - bsAdjective',
'Company - bsBuzz',
'Company - bsNoun',
'Database - column',
'Database - type',
'Database - collation',
'Database - engine',
'Date - past',
'Date - future',
'Date - between',
'Date - recent',
'Date - soon',
'Date - month',
'Date - weekday',
'Finance - account',
'Finance - accountName',
'Finance - routingNumber',
'Finance - mask',
'Finance - amount',
'Finance - transactionType',
'Finance - currencyCode',
'Finance - currencyName',
'Finance - currencySymbol',
'Finance - bitcoinAddress',
'Finance - litecoinAddress',
'Finance - creditCardNumber',
'Finance - creditCardCVV',
'Finance - ethereumAddress',
'Finance - iban',
'Finance - bic',
'Finance - transactionDescription',
'Git - branch',
'Git - commitEntry',
'Git - commitMessage',
'Git - commitSha',
'Git - shortSha',
'Hacker - abbreviation',
'Hacker - adjective',
'Hacker - noun',
'Hacker - verb',
'Hacker - ingverb',
'Hacker - phrase',
'Helpers - randomize',
'Helpers - slugify',
'Helpers - replaceSymbolWithNumber',
'Helpers - replaceSymbols',
'Helpers - replaceCreditCardSymbols',
'Helpers - repeatString',
'Helpers - regexpStyleStringParse',
'Helpers - shuffle',
'Helpers - mustache',
'Helpers - createCard',
'Helpers - contextualCard',
'Helpers - userCard',
'Helpers - createTransaction',
'Image - image',
'Image - avatar',
'Image - imageUrl',
'Image - abstract',
'Image - animals',
'Image - business',
'Image - cats',
'Image - city',
'Image - food',
'Image - nightlife',
'Image - fashion',
'Image - people',
'Image - nature',
'Image - sports',
'Image - technics',
'Image - transport',
'Image - dataUri',
'Image - lorempixel',
'Image - unsplash',
'Image - lorempicsum',
'Internet - avatar',
'Internet - email',
'Internet - exampleEmail',
'Internet - userName',
'Internet - protocol',
'Internet - url',
'Internet - domainName',
'Internet - domainSuffix',
'Internet - domainWord',
'Internet - ip',
'Internet - ipv6',
'Internet - userAgent',
'Internet - color',
'Internet - mac',
'Internet - password',
'Lorem - word',
'Lorem - words',
'Lorem - sentence',
'Lorem - slug',
'Lorem - sentences',
'Lorem - paragraph',
'Lorem - paragraphs',
'Lorem - text',
'Lorem - lines',
'Name - firstName',
'Name - lastName',
'Name - findName',
'Name - jobTitle',
'Name - gender',
'Name - prefix',
'Name - suffix',
'Name - title',
'Name - jobDescriptor',
'Name - jobArea',
'Name - jobType',
'Phone - phoneNumber',
'Phone - phoneNumberFormat',
'Phone - phoneFormats',
'Random - number',
'Random - float',
'Random - arrayElement',
'Random - arrayElements',
'Random - objectElement',
'Random - uuid',
'Random - boolean',
'Random - word',
'Random - words',
'Random - image',
'Random - locale',
'Random - alpha',
'Random - alphaNumeric',
'Random - hexaDecimal',
'System - fileName',
'System - commonFileName',
'System - mimeType',
'System - commonFileType',
'System - commonFileExt',
'System - fileType',
'System - fileExt',
'System - directoryPath',
'System - filePath',
'System - semver',
'Time - recent',
'Vehicle - vehicle',
'Vehicle - manufacturer',
'Vehicle - model',
'Vehicle - type',
'Vehicle - fuel',
'Vehicle - vin',
'Vehicle - color',
],
add : (val) => {
this.state.data.dataType = val,
this.state.data.data = {},
},
}
}
*/
Loading