https://github.com/timur-sh/queryman-builder
Queryman. Java tools for working with queries of PostgreSQL database.
https://github.com/timur-sh/queryman-builder
java postgresql postgresql-query-builder query-builder sql
Last synced: 7 months ago
JSON representation
Queryman. Java tools for working with queries of PostgreSQL database.
- Host: GitHub
- URL: https://github.com/timur-sh/queryman-builder
- Owner: timur-sh
- License: mit
- Created: 2018-01-19T12:36:37.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-10T04:29:07.000Z (almost 8 years ago)
- Last Synced: 2025-05-31T09:48:16.983Z (10 months ago)
- Topics: java, postgresql, postgresql-query-builder, query-builder, sql
- Language: Java
- Homepage: http://queryman.org/
- Size: 764 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- License: license.txt
Awesome Lists containing this project
README
Queryman Builder does only one thing - builds SQL query for PostgreSQL, but does it perfectly.
===
Queryman Builder provides a fluent Java API that allows to write SQL in object oriented way.
Documentation
===
* [http://queryman.org](http://queryman.org)
Getting started
===
Queryman can be used to build as a SQL string in object-oriented way, as a
`PreparedStatement`.
Queryman Builder does not require any configuration. Thus, everything you needed
to to add it to dependency and you can immediately start to use it:
Gradle:
```
compile group: 'org.queryman', name: 'queryman-builder', version: '1.0.0'
```
Maven:
```
org.queryman
queryman-builder
1.0.0
```
Build SQL query
====
Simple SQL query:
```
// SELECT * FROM book WHERE id = 15 AND price < 35.99 ORDER BY created_date LIMIT 10 OFFSET 50
Queryman.select("*")
.from("book")
.where("id", "=", 15)
.and("price", "<", 35.99)
.orderBy("created_date")
.limit(10)
.offset(50)
.sql();
```
Prepared SQL query:
```
// SELECT * FROM book WHERE id = ? AND price < ? ORDER BY created_date LIMIT 10 OFFSET 50
// Parameters:
// 1 -> 15
// 2 -> 35.99
Queryman.select("*")
.from("book")
.where("id", "=", 15)
.and("price", "<", 35.99)
.orderBy("created_date")
.limit(10)
.offset(50)
.buildPreparedStatement(connection);
```
For details look at the docs.
Common gradle tasks
==
* `build`
* `test`
* `publishToMavenLocal`