MCPcopy Index your code
hub / github.com/simstudioai/sim / generateUserRow

Function generateUserRow

packages/db/scripts/seed-stress-test-users.ts:101–116  ·  view source on GitHub ↗
(index: number)

Source from the content-addressed store, hash-verified

99}
100
101function generateUserRow(index: number): UserRow {
102 const firstName = randomItem(firstNames)
103 const lastName = randomItem(lastNames)
104 const domain = randomItem(['gmail.com', 'yahoo.com', 'outlook.com', 'company.com', 'work.org'])
105
106 return {
107 name: `${firstName} ${lastName}`,
108 email: `${firstName.toLowerCase()}.${lastName.toLowerCase()}${index}@${domain}`,
109 age: randomInt(22, 65),
110 department: randomItem(departments),
111 salary: randomInt(40000, 200000),
112 active: randomFloat() > 0.1, // 90% active
113 hire_date: randomDate(new Date('2015-01-01'), new Date('2024-12-31')),
114 country: randomItem(countries),
115 }
116}
117
118async function main() {
119 console.log(`Seeding ${TABLE_NAME} table for workspace ${WORKSPACE_ID}...`)

Callers 1

mainFunction · 0.85

Calls 4

randomItemFunction · 0.90
randomIntFunction · 0.90
randomFloatFunction · 0.90
randomDateFunction · 0.85

Tested by

no test coverage detected