Introduction
Bob helps build SQL queries. It does not try to abstract away SQL, or to hide implementation, instead Bob adds typed handrails to the query building for a better development experience.
Principles
The query builder is designed with the following principles
- Custom Crafting
- Progressive Enhancement
Read more about the principles.
Features
- Faster than comparable packages. See Benchmarks.
- Build any query. Supports the specification as closely as possible.
Dialect Support
Dialect | Raw | Select | Insert | Update | Delete |
---|---|---|---|---|---|
Postgres | ✅ | ✅ | ✅ | ✅ | ✅ |
MySQL/MariaDB | ✅ | ✅ | ✅ | ✅ | ✅ |
SQLite | ✅ | ✅ | ✅ | ✅ | ✅ |
Examples
Want to jump straight into examples?
📄️ Building Queries
How to build queries with Bob
📄️ Using the Query
How to use queries built with Bob
📄️ Quotes
How to use quotes with Bob
📄️ Parameters
To prevent SQL injection, it is necessary to use parameters in our queries. With bob use sm.Arg() where necessary. This will write the placeholder correctly in the generated sql, and return the value in the argument slice.
📄️ Starters
Common starters accross dialects
📄️ Operators
Common operators accross dialects
📄️ Principles
Custom Crafting & Progressive Enhancement
🗃️ PostgreSQL
2 items
🗃️ MySQL
2 items
🗃️ SQLite
2 items