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.
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
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.
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.
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.
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.
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.
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.
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.
Improve Javadoc. Rename parameters for more expressiveness. Replace ASCII filtering with filter Function to move actual filtering into dialects.
Original pull request: #19.
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.
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.
We now use java.lang.Long as fallback Id type for entities that do not declare an explicit Id property. Previously we used ObjectId which was a left-over from the initial draft of MappingRelationalEntityInformation.