Commit Graph

71 Commits

Author SHA1 Message Date
Spring Operator
7e3bcceeda #79 - URL Cleanup.
This commit updates URLs to prefer the https protocol. Redirects are not followed to avoid accidentally expanding intentionally shortened URLs (i.e. if using a URL shortener).

# Fixed URLs

## Fixed Success
These URLs were switched to an https URL with a 2xx status. While the status was successful, your review is still recommended.

* [ ] http://www.apache.org/licenses/ with 1 occurrences migrated to:
  https://www.apache.org/licenses/ ([https](https://www.apache.org/licenses/) result 200).
* [ ] http://www.apache.org/licenses/LICENSE-2.0 with 93 occurrences migrated to:
  https://www.apache.org/licenses/LICENSE-2.0 ([https](https://www.apache.org/licenses/LICENSE-2.0) result 200).

Original pull request: #79.
2019-03-22 10:14:40 +01:00
Spring Operator
37bb12cfef #76 - URL Cleanup.
This commit updates URLs to prefer the https protocol. Redirects are not followed to avoid accidentally expanding intentionally shortened URLs (i.e. if using a URL shortener).

# Fixed URLs

## Fixed But Review Recommended
These URLs were fixed, but the https status was not OK. However, the https status was the same as the http request or http redirected to an https URL, so they were migrated. Your review is recommended.

* [ ] http://www.reactive-streams.org/reactive-streams- (404) with 1 occurrences migrated to:
  https://www.reactive-streams.org/reactive-streams- ([https](https://www.reactive-streams.org/reactive-streams-) result 404).

## Fixed Success
These URLs were switched to an https URL with a 2xx status. While the status was successful, your review is still recommended.

* [ ] http://docs.spring.io/spring/docs/ with 7 occurrences migrated to:
  https://docs.spring.io/spring/docs/ ([https](https://docs.spring.io/spring/docs/) result 200).
* [ ] http://github.com/spring-projects/spring-data-r2dbc with 1 occurrences migrated to:
  https://github.com/spring-projects/spring-data-r2dbc ([https](https://github.com/spring-projects/spring-data-r2dbc) result 200).
* [ ] http://pivotal.io/ with 1 occurrences migrated to:
  https://pivotal.io/ ([https](https://pivotal.io/) result 200).
* [ ] http://projects.spring.io/spring-data-r2dbc/ with 1 occurrences migrated to:
  https://projects.spring.io/spring-data-r2dbc/ ([https](https://projects.spring.io/spring-data-r2dbc/) result 200).
* [ ] http://repo.spring.io/milestone/org/springframework/data/ with 1 occurrences migrated to:
  https://repo.spring.io/milestone/org/springframework/data/ ([https](https://repo.spring.io/milestone/org/springframework/data/) result 200).
* [ ] http://spring.io with 1 occurrences migrated to:
  https://spring.io ([https](https://spring.io) result 200).
* [ ] http://spring.io/blog with 2 occurrences migrated to:
  https://spring.io/blog ([https](https://spring.io/blog) result 200).
* [ ] http://spring.io/docs with 1 occurrences migrated to:
  https://spring.io/docs ([https](https://spring.io/docs) result 200).
* [ ] http://spring.io/projects/spring-data-r2dbc with 4 occurrences migrated to:
  https://spring.io/projects/spring-data-r2dbc ([https](https://spring.io/projects/spring-data-r2dbc) result 200).
* [ ] http://stackoverflow.com/questions/tagged/spring-data with 2 occurrences migrated to:
  https://stackoverflow.com/questions/tagged/spring-data ([https](https://stackoverflow.com/questions/tagged/spring-data) result 200).
* [ ] http://stackoverflow.com/questions/tagged/spring-data-r2dbc with 1 occurrences migrated to:
  https://stackoverflow.com/questions/tagged/spring-data-r2dbc ([https](https://stackoverflow.com/questions/tagged/spring-data-r2dbc) result 200).
* [ ] http://twitter.com/SpringData with 1 occurrences migrated to:
  https://twitter.com/SpringData ([https](https://twitter.com/SpringData) result 200).
* [ ] http://contributor-covenant.org with 1 occurrences migrated to:
  https://contributor-covenant.org ([https](https://contributor-covenant.org) result 301).
* [ ] http://contributor-covenant.org/version/1/3/0/ with 1 occurrences migrated to:
  https://contributor-covenant.org/version/1/3/0/ ([https](https://contributor-covenant.org/version/1/3/0/) result 301).
* [ ] http://help.github.com/forking/ with 1 occurrences migrated to:
  https://help.github.com/forking/ ([https](https://help.github.com/forking/) result 301).
* [ ] http://projects.spring.io/spring-data with 1 occurrences migrated to:
  https://projects.spring.io/spring-data ([https](https://projects.spring.io/spring-data) result 301).
* [ ] http://repo.spring.io/libs-milestone with 1 occurrences migrated to:
  https://repo.spring.io/libs-milestone ([https](https://repo.spring.io/libs-milestone) result 302).
2019-03-21 09:43:30 +01:00
Mark Paluch
6654db34c4 #59 - Consider custom conversion in MappingR2dbcConverter.
MappingR2dbcConverter now considers custom conversions for inbound and outbound conversion of top-level types (Row to Entity, Entity to OutboundRow) and on property level (e.g. convert an object to String and vice versa).

Original pull request: #70.
2019-03-18 15:24:48 +01:00
Mark Paluch
39936c67fa #59 - Simplify CustomConversions bean construction.
Original pull request: #70.
2019-03-18 15:24:18 +01:00
Mark Paluch
369522231f #41 - Polishing.
Rename RowDataConverter to R2dbcConverters. Introduce R2dbcSimpleTypeHolder. Apply custom conversions check in MappingR2dbcConverter. Extend tests.

Original pull request: #65.
2019-03-10 11:34:59 +01:00
Hebert Coelho
455e9a59de #41 - Add R2DBC converters.
Original pull request: #65.
2019-03-10 11:34:37 +01:00
Mark Paluch
feabe477a7 #61 - Move Conversion-related functionality to MappingR2dbcConverter.
All conversion functionality is now pulled together into MappingR2dbcConverter.

Introduce OutboundRow to provide mapping between column names and settable values. Remove identifier from SettableValue.

Original pull request: #62.
2019-03-05 14:03:43 +01:00
Jens Schauder
169de9df0a #56 - Polishing.
Replaced calls to `SqlRenderer.render(.)` with `SqlRenderer.toString(.)`.
And code formatting.

Original pull request: #66.
2019-03-05 13:48:31 +01:00
Mark Paluch
c241cd982e #56 - Use Statement Builder API for SELECT statements.
Original pull request: #66.
2019-03-05 13:36:27 +01:00
Mark Paluch
2cefdc8bdd #63 - Polishing.
Convert spaces to tabs. Replace version strings with managed dependencies. Javadoc.

Original pull request: #63.
2019-02-21 13:38:31 +01:00
Sebastien Deleuze
66b84d23f1 #63 - Add DatabaseClient Coroutines extensions.
This commit introduces Coroutines support for `DatabaseClient`
functional API via Kotlin extensions that provide suspendable
functions prefixed by `await` for `Mono` based APIs.

Extensions for `Flux` will be added when Kotlin/kotlinx.coroutines#254
will be fixed.

It also provides `asType<Foo>()` extensions useful for Reactive API
as well.

Original pull request: #63.
2019-02-21 13:38:14 +01:00
Mark Paluch
432b885853 #54 - Build against R2DBC 1.0 snapshots. 2019-02-01 09:43:51 +01:00
Mark Paluch
3d1041c0c8 #23 - Address review comments.
Original pull request: #47.
2019-01-18 14:00:30 +01:00
Jens Schauder
29f1edce0e #23 - Polishing.
Formatting.
Made Tests simpler and stricter by using `containsExactly`.
Added @Test annotation to ignored database specific tests so they actually show up as ignored.

Original pull request: #47.
2019-01-18 14:00:15 +01:00
Mark Paluch
b43b11936f #23 - Add support for named parameters.
DatabaseClient now supports named parameters prefixed with a colon such as :name in addition to database-native bind markers. Named parameters thus are supported in annotated repository query methods which also increases portability of queries across database vendors.

Named parameter support unrolls collection arguments to reduce the need for argument-specific SQL statements:

db.execute()
    .sql("SELECT id, name, state FROM table WHERE age IN (:ages)")
    .bind("ages", Arrays.asList(35, 50));

Results in a query: SELECT id, name, state FROM table WHERE age IN (35, 50)

Collection arguments containing nested object arrays can be used to use select lists:

List<Object[]> tuples = new ArrayList<>();
tuples.add(new Object[] {"John", 35});
tuples.add(new Object[] {"Ann",  50});

db.execute()
    .sql("SELECT id, name, state FROM table WHERE (name, age) IN (:tuples)")
    .bind("tuples", tuples);

translates to: SELECT id, name, state FROM table WHERE (name, age) IN (('John', 35), ('Ann', 50))

Original pull request: #47.
2019-01-18 14:00:08 +01:00
Mark Paluch
f90667b8ff #29 - Polishing.
Add author tags. Add static factory method to create an unavailable database object instance. Simplify database selection. Javadoc.

Original pull request: #51.
2019-01-18 13:50:56 +01:00
Jens Schauder
6f8bca6135 #29 - Use Testcontainers to run Postgres integration tests.
Postgres integration tests now run either with a locally installed and started database or if no such database can be found an instance gets started in a Docker container via Testcontainers.

We prefer a database based on TestContainers. Only if this can't be obtained do we try to access a local database for Postgres.

This minimizes the risk of accessing a database during tests that is not intended for that purpose.

If the system property `spring.data.r2dbc.test.preferLocalDatabase` is set to "true" the local database is preferred.

Original pull request: #51.
2019-01-18 13:50:24 +01:00
Mark Paluch
3a1085e244 #48 - Polishing.
Formatting.
2019-01-11 10:27:30 +01:00
Mark Paluch
836c5b4ec8 #48 - Atomically close connections.
We now make sure to close connections only once by tracking the cleanup state. Flux.usingWhen/Mono.usingWhen do not ensure atomic cleanup in situations where the subscription completes and then the subscription is terminated.

This behavior has lead to closing a connection multiple times.

Related ticket: reactor/reactor-core#1486
2019-01-11 10:25:55 +01:00
Mark Paluch
2dfb1ff20e #45 - Update copyright years to 2019. 2019-01-02 12:04:47 +01:00
Anbu Sampath
b321278df7 #38 - Add project metadata anchor to reference docs. 2018-12-12 19:28:53 +01:00
Mark Paluch
fcd9cc75dd #36 - Prepare 1.0 M1. 2018-12-12 14:07:12 +01:00
Mark Paluch
8f8462d8fd #36 - Updated changelog. 2018-12-12 14:07:11 +01:00
Mark Paluch
db24229bf4 #35 - Simplify reference documentation setup. 2018-12-10 10:24:41 +01:00
Mark Paluch
9f68352ac7 #30 - Address review feedback.
Introduce ArrayColumns type to encapsulate Dialect-specific array support.
Apply array conversion for properties that do not match the native array type.
Add integration tests for Postgres array columns.

Original pull request: #31.
2018-12-07 11:50:42 +01:00
Jens Schauder
be5383abed #30 - Polishing.
Minor formatting. Add suggestions.

Update src/test/java/org/springframework/data/r2dbc/dialect/PostgresDialectUnitTests.java

Co-Authored-By: mp911de <mpaluch@paluch.biz>

Original pull request: #31.
2018-12-07 11:50:22 +01:00
Mark Paluch
c357e5b543 #30 - Add custom conversion support.
We now support custom conversions via R2dbcCustomConversions.
Custom conversions introduces simple types that depend on the used dialect.
Custom conversions and simple types are held in RelationalConverter and MappingContext.

Simple types and conversions are used by DatabaseClient and repository support to properly apply registered converters and support native types such as array-columns.

Related tickets: #22, #26.
Original pull request: #31.
2018-12-07 11:49:47 +01:00
Mark Paluch
06c2a3a246 #22 - Polishing.
Add author tag. Add unit test for EntityRowMapper.

Original pull request: #31.
2018-12-07 11:49:15 +01:00
Ryland Degnan
f325f45fb6 #22 - Remove restriction on CollectionLike types.
EntityRowMapper now passes-thru values for Collection-like types such as array.
Arrays are supported by Postgres.

Original pull request: #22.
2018-12-07 11:48:26 +01:00
Mark Paluch
9e3601a06d #8 - Reduce API surface for mapped tabular results.
Move retrieval methods from FetchSpec into RowsFetchSpec and UpdatedRowsFetchSpec.

map(…) now returns RowsFetchSpec to not expose updated rows count as mapped results are consumed as objects.

Original pull request: #33.
2018-12-07 11:39:16 +01:00
Mark Paluch
6ad31abd79 #8 - Address review feedback.
Remove unused code from AbstractDatabaseClientIntegrationTests.
Use literal null instead of code null for consistency.

Original pull request: #33.
2018-12-07 11:39:03 +01:00
Jens Schauder
7db8e64393 #8 - Polishing.
Formatting, JavaDoc, issue comments on `@Test` annotations.
Removed some dead code.

Original pull request: #33.
2018-12-07 11:38:52 +01:00
Mark Paluch
5a5310af4d #8 - Replace exchange() method with map(…) and then() methods.
DatabaseClient now no longer exposes the exchange() method but rather provides map(…) and then(…) methods.
Calling map(…) extracts values from tabular results by propagating the mapping function to Result.map(…).
then() allows statement execution without returning the result propagating only completion and error signals.

Original pull request: #33.
2018-12-07 11:38:03 +01:00
Jens Schauder
8461545670 #25 - Polishing.
Fix typos. Improve wording. Replace document with row and collection with table.

Original pull request: #28.
2018-12-04 09:53:31 +01:00
Mark Paluch
a6140b8ba8 #25 - Add reference documentation.
Original pull request: #28.
2018-12-04 09:53:26 +01:00
Jens Schauder
0aa623280f #20 - Polishing.
Rename Database.latestDialect() to defaultDialect(). Rename Dialect.returnGeneratedKeys() to Dialect.generatedKeysClause(). Simplify IndexBindMarkers. Create BindableOperation.bind(Statement, SettableValue) to reduce code duplicates. Rename BindSpecWrapper to BindSpecAdapter.

Original pull request: #24.
2018-12-03 16:01:39 +01:00
Mark Paluch
68f1e0b0b3 #20 - Add Dialect initial support for H2, PostgreSQL, and Microsoft SQL Server.
We now provide dialect support for H2, PostgreSQL, and Microsoft SQL Server databases, configurable through AbstractR2dbcConfiguration. By default, we obtain the Dialect by inspecting ConnectionFactoryMetadata to identify the database and the most likely dialect to use.

BindableOperation encapsulates statements/queries that can accept parameters. Use BindableOperation for statements through DatabaseClient.
Extract SQL creation.

Split integration test into abstract base class that can be implemented with a database-specific test class.

Original pull request: #24.
2018-12-03 16:01:35 +01:00
Christoph Strobl
9f7d3863e5 #13 - Polishing.
Add missing header & package-info. Update nullability and add tests.

Original pull request: #17.
2018-11-21 10:21:17 +01:00
Mark Paluch
6267047f17 #16 - Add abstract configuration class for R2DBC.
We now provide an abstract R2DBC configuration that registers beans required for R2DBC's DatabaseClient.

Original pull request: #17.
2018-11-21 10:21:14 +01:00
Mark Paluch
881c97784b #13 - Add @EnableR2dbcRepositories.
We now provide an annotation-based activation model for R2DBC repositories. Configuration classes can be annotated with @EnableR2dbcRepositories and configuration infrastructure will scan for bean definitions to implement declared R2DBC repositories.

Original pull request: #17.
2018-11-21 10:21:07 +01:00
Mark Paluch
5df9b355eb #15 - Incorporate review feedback.
Improve Javadoc. Rename parameters for more expressiveness. Replace ASCII filtering with filter Function to move actual filtering into dialects.

Original pull request: #19.
2018-11-21 10:16:14 +01:00
Mark Paluch
9700c3c087 #15 - Add BindMarkers abstraction.
We now expose a bind marker API that allows to model a vendor-specific bind marker strategy. The currently supported database systems (Postgres, MsSql) implement indexed respective named strategies that differ in how placeholders and identifiers are generated.

Original pull request: #19.
2018-11-21 10:16:05 +01:00
Mark Paluch
226c80fb02 #12 - Retain input item order in save(…) methods.
We now use concatMap(…) instead of flatMap(…) when saving items to retain output item order.
2018-11-12 15:13:19 +01:00
Mark Paluch
93ddaff3c2 #11 - Adapt Statement.bind(…) calls to newly introduced positional (integer-arg) binding.
We now use bind(int, …) methods to bind parameters by index.
2018-11-12 15:04:29 +01:00
Mark Paluch
c2ebfb8cd3 #10 - Adapt to removed Statement.executeReturningGeneratedKeys(). 2018-11-12 15:00:27 +01:00
Mark Paluch
12dc98bcbd #2 - Polishing. 2018-10-17 11:11:16 +02:00
Mark Paluch
d60d8b04a0 #2 - Switch dependency test to assumption. 2018-10-17 11:11:13 +02:00
Mark Paluch
a5e2a8e61f #2 - Polishing.
Introduce customization hook methods. Rename DefaultTypedGenericExecuteSpec to DefaultTypedExecuteSpec and GenericExecuteSpecSupport to ExecuteSpecSupport as types are not tied to generic execution. Encapsulate fields in DatabaseClient builders.
2018-10-17 11:11:10 +02:00
Mark Paluch
20eb2c1a6d #2 - Resolve package cycle between r2dbc.function and r2dbc.function.convert. 2018-10-17 11:11:09 +02:00
Mark Paluch
f223475112 #2 - Adapt to R2DBC API changes. 2018-10-17 11:11:07 +02:00