A developer’s guide to querying databases in Python, JavaScript, Java, Go, Rust, and more — with code samples, best libraries, and comparisons.
Whether you're building a backend service, running analytics, or integrating with a production database, knowing how to write SQL from your favorite programming language is a critical skill for any developer.
While SQL is a powerful declarative language on its own, most applications need to run queries dynamically - from Python scripts, JavaScript/TypeScript backends, Go microservices, or Java apps. That’s where language-specific SQL tools come in: they help you connect, write, and run queries from code - safely and efficiently.
Depending on your stack and use case, you might choose between:
Raw SQL, for full control and transparency
A query builder, which provides abstraction with flexibility
An ORM (Object-Relational Mapper), which lets you work with database rows as native objects in your language
Each approach comes with tradeoffs. Raw SQL gives you complete freedom and performance, but can be verbose and error-prone. Query builders like knex.js or sqlx offer flexibility with fewer bugs. And ORMs like SQLAlchemy, Prisma, or GORM can speed up development but often abstract away important SQL details.
This directory made by the Galaxy team will show you how to:
🔍 Write SQL in Python using libraries like pandas, SQLAlchemy, and DuckDB
🧠 Discover SQL libraries for JavaScript like Prisma, Drizzle, and knex.js
⚙️ Compare the best SQL ORMs for Go like GORM and sqlc
⚖️ Understand the tradeoffs between raw SQL vs ORM vs query builder
Learn how to query SQL in any language!
We've aggregated some of the most common errors we've seen in SQL to help teams fix them!
Check outTake a look at which databases, tools, and platforms Galaxy's modern SQL tool integrates with :)
Check out