GithubHelp home page GithubHelp logo

timur-sh / queryman-builder Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 1.0 782 KB

Queryman. Java tools for working with queries of PostgreSQL database.

Home Page: http://queryman.org/

License: MIT License

Java 99.90% SQLPL 0.10%
java sql query-builder postgresql postgresql-query-builder

queryman-builder's Introduction

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

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:

<dependency>
    <groupId>org.queryman</groupId>
    <artifactId>queryman-builder</artifactId>
    <version>1.0.0</version>
</dependency>

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

queryman-builder's People

Contributors

timur-sh avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

alancwb

queryman-builder's Issues

Docs

  • Expression #53
  • UPDATE statement #52
  • INSERT statement #41
  • Documentation for conditions #40
  • Documentation for CREATE SEQUENCE #39
  • Documentation for SELECT #30

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.