We compressed client.execute().sql(…) to client.execute(…) to not require the intermediate execute() step but rather accept the SQL to execute directly.
Original pull request: #112.
We now correctly consider built-in converters for simple types that are read through DatabaseClient. Simple type projections typically select a single column and expect a result stream of simple values such as selecting a count and retrieving a Mono<Long>.
Extract method references for better readability. Add missing tests and update documentation.
Add delay for transactional MySql tests to avoid failures due to potentially delayed transaction id storage within the database.
Original Pull Request: #107
We now support R2DBC transaction management through ConnectionFactoryTransactionManager which is a ReactiveTransactionManager implementation to be used with TransactionalOperator and Spring's declarative transaction management.
ConnectionFactoryTransactionManager tm = new ConnectionFactoryTransactionManager(connectionFactory);
TransactionalOperator operator = TransactionalOperator.create(tm);
DatabaseClient db = DatabaseClient.create(connectionFactory);
Mono<Void> atomicOperation = db.execute().sql("INSERT INTO person (id, name, age) VALUES(:id, :name, :age)")
.bind("id", "joe")
.bind("name", "Joe")
.bind("age", 34)
.fetch().rowsUpdated()
.then(db.execute().sql("INSERT INTO contacts (id, name) VALUES(:id, :name)")
.bind("id", "joe")
.bind("name", "Joe")
.fetch().rowsUpdated())
.then()
.as(operator::transactional);
Original Pull Request: #107
Incorporated feedback from review. Polished documentation and Javadoc. Minor code improvements restructuring for better readability. Removed unused methods types. Some polishing for compiler warnings.
Original pull request: #106.
Document fluent API. Add fluent API for update. Introduce StatementMapper. Migrate Insert to StatementMapper. Refactoring and cleanup. Migrate Select to StatementMapper.
Original pull request: #106.
We now support Criteria creation and mapping to express where conditions with a fluent API.
databaseClient.select().from("legoset")
.where(Criteria.of("name").like("John%").and("id").lessThanOrEquals(42055));
databaseClient.delete()
.from(LegoSet.class)
.where(Criteria.of("id").is(42055))
.then()
databaseClient.delete()
.from(LegoSet.class)
.where(Criteria.of("id").is(42055))
.fetch()
.rowsUpdated()
Original pull request: #106.
We now apply bindings to a BindTarget that can be overridden without the need to implement all Statement methods.
PreparedOperation no longer has a direct dependency on R2DBC Statement.
Original pull request: #82.
We now ship our own SqlProvider variant to not require Spring JDBC as mandatory dependency. Spring JDBC can be provided optionally to use SQL-code based exception translation.
We now attempt to lookup ConnectionFactory from ApplicationContext and fall back to a local
method call if ConnectionFactory is not exposed as bean.
Original pull request: #96.
Clarified code a little.
Added a warning to `AnonymousBindMarkers`:
Anonymous bind markers are problematic because the have to appear in generated SQL in the same order they get generated.
This might cause challenges in the future with complex generate statements.
For example those containing subselects which limit the freedom of arranging bind markers.
Original pull request: #84.
We now support MySQL through the jasync-mysql driver that exposes its asynchronous functionality through a R2DBC wrapper implementation.
Jasync uses for now its own exceptions.
Original pull request: #84.
Anonymous indexed bind markers come with a static placeholder symbol for all parameter occurrences and they are bound by index.
Original pull request: #84.
SimpleR2dbcRepository.save(…) now falls back to the saved object as emitted result if the INSERT statement does not return generated keys.
Adding H2 database engine for tests to simulate such behavior.
Original pull request: #90.
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.
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.