Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
getDbStructure() {
const customers: ITable = {
name: 'Customers',
columns: {
customerId: { primaryKey: true, autoIncrement: true },
customerName: { notNull: true, dataType: DATA_TYPE.String },
contactName: { notNull: true, dataType: DATA_TYPE.String },
address: { notNull: true, dataType: 'string' },
city: { notNull: true, dataType: 'string' },
postalCode: { dataType: 'string' },
country: { notNull: true, dataType: 'string' }
}
};
const categories: ITable = {
name: 'Categories',
columns: {
categoryId: { primaryKey: true, autoIncrement: true },
categoryName: { notNull: true, dataType: 'string' },
description: { notNull: true, dataType: 'string' }
}
};
getDbStructure() {
const customers: ITable = {
name: 'Customers',
columns: {
customerId: { primaryKey: true, autoIncrement: true },
customerName: { notNull: true, dataType: DATA_TYPE.String },
contactName: { notNull: true, dataType: DATA_TYPE.String },
address: { notNull: true, dataType: 'string' },
city: { notNull: true, dataType: 'string' },
postalCode: { dataType: 'string' },
country: { notNull: true, dataType: 'string' }
}
};
const categories: ITable = {
name: 'Categories',
columns: {
categoryId: { primaryKey: true, autoIncrement: true },
categoryName: { notNull: true, dataType: 'string' },
description: { notNull: true, dataType: 'string' }
}
};
const getDatabase = () => {
const tblStudent: ITable = {
name: 'Students',
columns: {
id: {
primaryKey: true,
autoIncrement: true
},
name: {
notNull: true,
dataType: DATA_TYPE.String
},
gender: {
dataType: DATA_TYPE.String,
default: 'male'
},
country: {
notNull: true,
dataType: DATA_TYPE.String
},
city: {
dataType: DATA_TYPE.String,
notNull: true
}
}
};
const dataBase: IDataBase = {
name: dbname,
tables: [tblStudent]
};
const getDatabase = () => {
const tblStudent = {
name: 'Students',
columns: {
id: {
primaryKey: true,
autoIncrement: true
},
name: {
notNull: true,
dataType: DATA_TYPE.String
},
gender: {
dataType: DATA_TYPE.String,
default: 'male'
},
country: {
notNull: true,
dataType: DATA_TYPE.String
},
city: {
dataType: DATA_TYPE.String,
notNull: true
}
}
};
const dataBase = {
const getDatabase = () => {
const tblStudent: ITable = {
name: 'Students',
columns: {
id: {
primaryKey: true,
autoIncrement: true
},
name: {
notNull: true,
dataType: DATA_TYPE.String
},
gender: {
dataType: DATA_TYPE.String,
default: 'male'
},
country: {
notNull: true,
dataType: DATA_TYPE.String
},
city: {
dataType: DATA_TYPE.String,
notNull: true
}
}
};
const dataBase: IDataBase = {
const getDatabase = () => {
const tblStudent = {
name: 'Students',
columns: {
id: {
primaryKey: true,
autoIncrement: true
},
name: {
notNull: true,
dataType: DATA_TYPE.String
},
gender: {
dataType: DATA_TYPE.String,
default: 'male'
},
country: {
notNull: true,
dataType: DATA_TYPE.String
},
city: {
dataType: DATA_TYPE.String,
notNull: true
}
}
};
const dataBase = {
name: dbname,
tables: [tblStudent]
};
columns: [{
name: 'id',
primaryKey: true,
autoIncrement: true
}, {
name: 'submissionId',
notNull: true,
dataType: DATA_TYPE.Number
}, {
name: 'fileInfo',
notNull: true,
dataType: DATA_TYPE.Object
}, {
name: 'fileType',
notNull: true,
dataType: DATA_TYPE.String
}, {
name: 'buffer',
notNull: true,
dataType: DATA_TYPE.Object
}]
}
export { SubmissionFileTable, SubmissionFileTableName }
columns: [{
name: 'id',
primaryKey: true,
autoIncrement: true
}, {
name: 'submissionId',
notNull: true,
dataType: DATA_TYPE.Number
}, {
name: 'submissionFileId',
notNull: true,
dataType: DATA_TYPE.Number
}, {
name: 'fileType',
notNull: true,
dataType: DATA_TYPE.String
}, {
name: 'buffer',
notNull: true,
dataType: DATA_TYPE.Object
}]
}
export { GeneratedThumbnailTable, GeneratedThumbnailTableName }
const getDatabase = () => {
const tblStudent = {
name: 'Students',
columns: {
id: {
primaryKey: true,
autoIncrement: true
},
name: {
notNull: true,
dataType: DATA_TYPE.String
},
gender: {
dataType: DATA_TYPE.String,
default: 'male'
},
country: {
notNull: true,
dataType: DATA_TYPE.String
},
city: {
dataType: DATA_TYPE.String,
notNull: true
}
}
};
const dataBase = {
autoIncrement: true
},
name: {
notNull: true,
dataType: DATA_TYPE.String
},
gender: {
dataType: DATA_TYPE.String,
default: 'male'
},
country: {
notNull: true,
dataType: DATA_TYPE.String
},
city: {
dataType: DATA_TYPE.String,
notNull: true
}
}
};
const dataBase: IDataBase = {
name: dbname,
tables: [tblStudent]
};
return dataBase;
};