~/talk

How To Generate Test Data for Your Database Project

Talkat Conf42 Python 2023 Β· on Thursday, 2023-03-09Β· [databases, testing]
linkedin:mariogmd
slides:none on file

Generates reproducible test rows with Faker + pandas pipeline, writes to MySQL/Postgres via pandas.DataFrame.to_sql and to MongoDB via insert_many, and ships a runnable repo and env files. Uses SQLAlchemy only for connections, then adds an auto‑increment/serial primary key with ALTER after bulk insert. Splits work across CPU cores minus one with multiprocessing (example: 60,000 rows β†’ 15 cores Γ— 4,000 each) and shows progress with tqdm.

AI-written summary Β· about

  1. 0:00Test data generation intro
  2. 1:16Choosing data generation approach
  3. 3:51Project dependencies setup
  4. 6:44Faker for realistic data
  5. 9:12Multiprocessing for speed
  6. 12:22MySQL and PostgreSQL connection
  7. 14:27MongoDB connection
  8. 15:28Schema with pandas
  9. 17:34Multiprocessing pool
  10. 20:50Adding primary keys
  11. 22:39Running generation script
  12. 24:07Verifying data
  13. 24:27Resources and conclusion
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark β€” the status bar button does the same
?
this help
esc
close this, then clear every filter β€” or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.