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.
The query builder is designed with the following principles
- Custom Crafting
- Progressive Enhancement
Read more about the principles.
- Faster than comparable packages. See Benchmarks.
- Build any query. Supports the specification as closely as possible.
Want to jump straight into examples?
📄️ Building Queries
How to build queries with Bob
📄️ Using the Query
How to use queries built with Bob
How to use quotes with Bob
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.
Common starters accross dialects
Common operators accross dialects
Custom Crafting & Progressive Enhancement