forked from typelevel/doobie
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
104 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
layout: book | ||
number: 12 | ||
title: Managing Connections | ||
--- | ||
|
||
### Using the `java.sql.DriverManager` | ||
|
||
### Using HikariCP | ||
|
||
The `doobie-contrib-hikari` add-on provides a `Transactor` implementation backed by a [HikariCP](https://github.com/brettwooldridge/HikariCP) connection pool. Constructing an instance is an effect: | ||
|
||
```scala | ||
for { | ||
xa <- HikariTransactor[Task]("jdbc:h2:mem:test;DB_CLOSE_DELAY=-1", "sa", "") | ||
_ <- longRunningProgram(xa) ensuring xa.shutdown | ||
} yield () | ||
``` | ||
|
||
The returned instance is of type `HikariTransactor`, which provides a `shutdown` method (shown above) as well as a `configure` method that provides access to the underlying `HikariDataSource`. See the source for details. | ||
|
||
### Using an Existing `java.sql.Connection` | ||
|
||
|
||
### Using an Existing `javax.sql.DataSource` | ||
|
||
|
||
### Building your own `Transactor` | ||
|
||
|
||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
--- | ||
layout: book | ||
number: 13 | ||
title: Extensions for PostgreSQL | ||
--- | ||
|
||
|
||
### Array Types | ||
|
||
Postgres typed arrays are supported and map to `Array`, `List`, `Vector`. Multi-dimensional arrays are not supported yet. | ||
|
||
### Enum Types | ||
|
||
### Geometric Types | ||
|
||
The following geometric types are supported, and map to driver-supplied types. These will normally be mapped to application-specific types. | ||
- the `box` schema type maps to `org.postgresql.geometric.PGbox` | ||
- the `circle` schema type maps to `org.postgresql.geometric.PGcircle` | ||
- the `lseg` schema type maps to `org.postgresql.geometric.PGlseg` | ||
- the `path` schema type maps to `org.postgresql.geometric.PGpath` | ||
- the `point` schema type maps to `org.postgresql.geometric.PGpoint` | ||
- the `polygon` schema type maps to `org.postgresql.geometric.PGpolygon` | ||
|
||
### PostGIS Types | ||
|
||
This adds support for the main PostGIS types: | ||
|
||
- `PGgeometry` | ||
- `PGbox2d` | ||
- `PGbox3d` | ||
|
||
As well as the following abstract and fine-grained types carried by `PGgeometry`: | ||
|
||
- `Geometry` | ||
- `ComposedGeom` | ||
- `GeometryCollection` | ||
- `MultiLineString` | ||
- `MultiPolygon` | ||
- `PointComposedGeom` | ||
- `LineString` | ||
- `MultiPoint` | ||
- `Polygon` | ||
- `Point` | ||
|
||
### Miscellaneous Nonstandard Types | ||
|
||
- The `uuid` schema type is supported and maps to `java.util.UUID`. | ||
- The `inet` schema type is supported and maps to `java.net.InetAddress`. | ||
|
||
### Error Handling Extensions | ||
|
||
A complete table of SQLSTATE values is provided in the `doobie.contrib.postgresql.sqlstate` module, and recovery combinators for each of these (`onUniqueViolation` for example) are provided in `doobie.contrib.postgresql.syntax`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
layout: book | ||
number: 14 | ||
title: Extensions for H2 | ||
--- | ||
|
||
The `doobie-contrib-h2` add-on provides mappings for the following [H2](http://www.h2database.com/html/main.html) types in the `doobie.contrib.h2.h2types` module. | ||
|
||
### Array Types | ||
|
||
- H2 `array` types are supported and map to `Array`, `List`, `Vector`. | ||
|
||
### Other Nonstandard Types | ||
|
||
- The `uuid` type is supported and maps to `java.util.UUID`. |