finagle-postgres-shapeless


License

License

GroupId

GroupId

io.github.finagle
ArtifactId

ArtifactId

finagle-postgres-shapeless_2.12
Last Version

Last Version

0.13.0
Release Date

Release Date

Type

Type

jar
Description

Description

finagle-postgres-shapeless
finagle-postgres-shapeless
Project URL

Project URL

https://finagle.github.io/finagle-postgres
Project Organization

Project Organization

io.github.finagle
Source Code Management

Source Code Management

https://github.com/finagle/finagle-postgres

Download finagle-postgres-shapeless_2.12

How to add to project

<!-- https://jarcasting.com/artifacts/io.github.finagle/finagle-postgres-shapeless_2.12/ -->
<dependency>
    <groupId>io.github.finagle</groupId>
    <artifactId>finagle-postgres-shapeless_2.12</artifactId>
    <version>0.13.0</version>
</dependency>
// https://jarcasting.com/artifacts/io.github.finagle/finagle-postgres-shapeless_2.12/
implementation 'io.github.finagle:finagle-postgres-shapeless_2.12:0.13.0'
// https://jarcasting.com/artifacts/io.github.finagle/finagle-postgres-shapeless_2.12/
implementation ("io.github.finagle:finagle-postgres-shapeless_2.12:0.13.0")
'io.github.finagle:finagle-postgres-shapeless_2.12:jar:0.13.0'
<dependency org="io.github.finagle" name="finagle-postgres-shapeless_2.12" rev="0.13.0">
  <artifact name="finagle-postgres-shapeless_2.12" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.github.finagle', module='finagle-postgres-shapeless_2.12', version='0.13.0')
)
libraryDependencies += "io.github.finagle" % "finagle-postgres-shapeless_2.12" % "0.13.0"
[io.github.finagle/finagle-postgres-shapeless_2.12 "0.13.0"]

Dependencies

compile (6)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.12.11
io.github.finagle : finagle-postgres_2.12 jar 0.13.0
com.twitter : finagle-core_2.12 jar 21.3.0
com.twitter : finagle-netty4_2.12 jar 21.3.0
com.chuusai : shapeless_2.12 jar 2.3.3
io.github.jeremyrsmith : patchless-core_2.12 jar 1.0.7

test (5)

Group / Artifact Type Version
org.scalatest : scalatest_2.12 jar 3.2.0
org.scalatestplus : scalatestplus-scalacheck_2.12 jar 3.1.0.0-RC2
org.scalacheck : scalacheck_2.12 jar 1.14.3
org.scalamock : scalamock_2.12 jar 4.4.0
io.circe : circe-testing_2.12 jar 0.12.3

Project Modules

There are no modules declared in this project.

Finagle Postgres

Build status Maven Central Join the chat at https://gitter.im/finagle/finagle-postgres

This library provides PostgreSQL database support for Finagle.

Documentation

See the GitHub Pages

Using the Postgres client

Installation

Finagle Postgres is published on Maven Central. Use the following sbt snippet to bring it as a dependency.

libraryDependencies ++= Seq(
  "io.github.finagle" %% "finagle-postgres" % "0.12.0"
)

Connecting to the DB

val client = Postgres.Client()
  .withCredentials("user", Some("password"))
  .database("dbname")
  .withSessionPool.maxSize(1) //optional; default is unbounded
  .withBinaryResults(true)
  .withBinaryParams(true)
  .withTransport.tls("host")
  .newRichClient("host:port")

Selecting with simple query

val f = client.select("select * from users") {row =>
    User(row.getString("email"), row.getString("name"))
}
logger.debug("Responded " + Await.result(f))

Integration Tests

sbt test won't run integration tests by default. In order to make it easier for development, a database environment is provided via Docker. After installing Docker and docker compose, run:

docker-compose up -d

A few environment variables need to be provided as well:

export PG_HOST_PORT=localhost:5432 PG_DBNAME=finagle_postgres_test PG_USER=postgres

With the database and variables in place, all tests will be executed. More details in IntegrationSpec

Changelog

See CHANGELOG.md

Contributors

License

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this software except in compliance with the License.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

io.github.finagle

Finagle

Finagle ecosystem projects

Versions

Version
0.13.0
0.12.0
0.11.0
0.10.0
0.9.0
0.8.2
0.8.0
0.7.0