Stage 2 · Lesson 5 of 6
Talking to it from code: drivers, ORMs and migrations
Your app talks to the database through a , the library that sends queries, or an ORM (object-relational mapper), such as Prisma, Django ORM, Entity Framework or SQLAlchemy, which maps tables to objects in your language. Either way, change your through migrations: small, versioned scripts kept in that add a column or an , run in order on every environment.
That way your laptop, a teammate's laptop and production all have the same tables. Always pass user input as query parameters, never by gluing strings into SQL, which prevents . ORMs speed up common work, but learn to read the SQL they produce.
Common trapediting the production schema by hand in a GUI and then not knowing why the app breaks elsewhere.
A question to check yourself, an AI practice session and 1 cheat sheet entry come with the full roadmap. Unlock
Resources for this stage
Start with· follow one of these
- CoursePaidGrokking Relational Database Design and Modeling
Design Gurus · Intermediate · $98 one-time
Data modelling, ER diagrams, keys and normalisation for the relational default, with worked designs
- GuideFreePostgreSQL Tutorial
PostgreSQL Global Development Group · Beginner
The short official tutorial: create a database, tables and your first queries in an evening
Practise
Keep handy
Also worth your time
json versus jsonb, the operators and how to index JSON for fast lookups
- Sefism SQL and Databases RoadmapGo deeper
The full Sefism roadmap for SQL: queries, schema design, transactions, indexes and SQL from code