GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - bendem/sql-streams: Painless low level jdbc abstraction using the java 8 stream api.

BranchesTags
Open more actions menu

Latest commit

 

History

108 Commits
108 Commits

Folders and files

NameName
Last commit message
Last commit date
src
src
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
codecov.yml
codecov.yml
 
 
pom.xml
pom.xml
 
 

Repository files navigation

sql-streams

Codeship Status for bendem/sql-streams

sql-streams is a tool for the people that don't need or want to use an ORM but don't want to deal with the JDBC API either. It provides a light abstraction over JDBC without ever making it inaccessible.

Features

  • Simple setup if you already have a Connection or a DataSource available
  • Fluent API
  • ResultSet is abstracted to a Stream
  • Classes that can be closed are AutoCloseable
  • SQLException are wrapped into UncheckedSqlException
  • Doesn't try to hide the JDBC primitives, they are never further than a method call away
  • Automatic type deduction with the with method

Getting started

To get started, all you need to do is to add sql-streams to your dependencies:

<dependency>
    <groupId>be.bendem</groupId>
    <artifactId>sql-streams</artifactId>
    <version>[current version]</version>
</dependency>
compile 'be.bendem:sql-streams:[current version]'

Once it is done, you can create an instance of Sql using one of the two connect methods.

try (Sql sql = Sql.connect(datasource)) {
    Optional<String> userEmail = sql
        .first("select email from users where user_id = ?")
        .with(userId);
}

If you are using spring-boot, checkout sql-streams-spring!

Development

You will need maven to compile and install this library

mvn install

In addition to the SQLite and H2 tests, you can run the tests with PostgreSQL by providing a jdbc connection url:

PGURL=jdbc:postgresql:test mvn test
# or with user and password if not using peer authentication
PGURL=jdbc:postgresql://localhost/test PGUSER=test PGPASSWORD=test mvn test

About

Painless low level jdbc abstraction using the java 8 stream api.

Topics

databasejavajava-8sqlsql-streamsstreamstreams

Resources

Readme
MIT license
Activity

Stars

28 stars

Watchers

4 watching

Forks

5 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.