mirror of
https://github.com/aljazceru/turso.git
synced 2026-02-23 17:05:36 +01:00
gen-database: add age to user table to test agg
Signed-off-by: Pere Diaz Bou <pere-altea@hotmail.com>
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
import sqlite3
|
||||
from faker import Faker
|
||||
import random
|
||||
|
||||
conn = sqlite3.connect('database.db')
|
||||
cursor = conn.cursor()
|
||||
@@ -17,7 +18,8 @@ cursor.execute('''
|
||||
address TEXT,
|
||||
city TEXT,
|
||||
state TEXT,
|
||||
zipcode TEXT
|
||||
zipcode TEXT,
|
||||
age INTEGER
|
||||
)
|
||||
''')
|
||||
|
||||
@@ -31,11 +33,14 @@ for _ in range(10000):
|
||||
city = fake.city()
|
||||
state = fake.state_abbr()
|
||||
zipcode = fake.zipcode()
|
||||
age = random.randint(0, 100) % 99
|
||||
|
||||
cursor.execute('''
|
||||
INSERT INTO users (first_name, last_name, email, phone_number, address, city, state, zipcode)
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?)
|
||||
''', (first_name, last_name, email, phone_number, address, city, state, zipcode))
|
||||
INSERT INTO users (first_name, last_name, email, phone_number, address, city, state, zipcode, age)
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
|
||||
''', (first_name, last_name, email, phone_number, address, city, state, zipcode, age))
|
||||
|
||||
|
||||
|
||||
conn.commit()
|
||||
conn.close()
|
||||
|
||||
Reference in New Issue
Block a user