Commit Graph

156 Commits

Author SHA1 Message Date
Greg Turnquist
7628fd25f6 #121 - Use parent 'artifactory' profile for snapshot releases. 2019-07-05 11:31:43 -05:00
Greg Turnquist
47e181262e #121 - Only build main branch for upstream triggers. 2019-06-28 19:39:15 -05:00
Greg Turnquist
f6e94cdfa7 #121 - Set user.name and user.home for CI jobs. 2019-06-25 14:08:29 -05:00
Mark Paluch
82aad7c4f5 #141 - Add support for schema initialization.
We now provide DatabasePopulator and ScriptUtils to run SQL scripts using R2DBC Connections to initialize and clean up databases.
2019-06-22 20:57:07 +02:00
Greg Turnquist
a21b403e6d #121 - Introduce Jenkins. 2019-06-11 20:24:04 -05:00
Mark Paluch
0d5f5089be #135 - Adapt to renamed TransactionSynchronizationManager.forCurrentTransaction(). 2019-06-05 14:35:16 +02:00
Mark Paluch
bedc18bc69 #105 - Move named parameter resolution to ReactiveDataAccessStrategy.
Named parameter resolution is now provided as part of ReactiveDataAccessStrategy. This allows us to hide implementation internals (bind markers). DatabaseClient allows configuration whether to use named parameter expansion.

Detailed configuration of named parameter support is now moved to DefaultReactiveDataAccessStrategy.

Original pull request: #105.
2019-06-04 14:34:35 +02:00
Jens Schauder
7372efe3e6 #98 - Polishing.
Formatting.
Changed generics to avoid unchecked casting.
Avoided abbreviated variable name.
Simplified handling of absent keys at ConnectionFactory lookup.

Original pull request: #132.
2019-06-04 11:53:06 +02:00
Mark Paluch
e3aae619f4 #98 - Add support for AbstractRoutingConnectionFactory.
We now provide an abstract base class for ConnectionFactory routing. Routing keys are typically obtained from a subscriber context. AbstractRoutingConnectionFactory is backed by either a map of string identifiers or connection factories. When using string identifiers, these can map agains e.g. Spring bean names that can be resolved using BeanFactoryConnectionFactoryLookup.

class MyRoutingConnectionFactory extends AbstractRoutingConnectionFactory {

		@Override
		protected Mono<Object> determineCurrentLookupKey() {
			return Mono.subscriberContext().filter(it -> it.hasKey(ROUTING_KEY)).map(it -> it.get(ROUTING_KEY));
		}
}

@Bean
public void routingConnectionFactory() {

		MyRoutingConnectionFactory router = new MyRoutingConnectionFactory();

		Map<String, ConnectionFactory> factories = new HashMap<>();
		ConnectionFactory myDefault = …;
		ConnectionFactory primary = …;
		ConnectionFactory secondary = …;

		factories.put("primary", primary);
		factories.put("secondary", secondary);

		router.setTargetConnectionFactories(factories);
		router.setDefaultTargetConnectionFactory(myDefault);

		return router;
}

Original pull request: #132.
2019-06-04 11:52:32 +02:00
Mark Paluch
16d4a66f6a #134 - Create security policy readme. 2019-05-31 15:17:42 +02:00
Mark Paluch
d6c812a4eb #104 - Incorporate review feedback.
Original pull request: #127.
2019-05-27 17:11:30 +02:00
Mark Paluch
9f6cf4061c #104 - Polishing.
Fix documentation links. Use variables for links to Spring Framework reference docs.

Original pull request: #127.
2019-05-27 17:11:30 +02:00
Mark Paluch
043e8a6855 #104 - Provide extension mechanism for R2dbcDialect resolution.
We now use Spring's spring.factories mechanism to register and lookup R2dbcDialectProvider implementations.
This allows a pluggable model for third party implementations to ship R2dbcDialect support that can be auto-discovered.

Original pull request: #127.
2019-05-27 17:11:29 +02:00
Toshiaki Maki
85dcf6b71d #130 - Fix scheme name in sample code.
Fix scheme name.
2019-05-24 16:10:41 +02:00
Mark Paluch
376bfef387 #128 - Fix NullPointerException calling bindNull() with enabled named parameter support. 2019-05-23 10:09:31 +02:00
Mark Paluch
67c71fd584 #87 - Polishing.
Qualify field access with this.
2019-05-22 15:50:28 +02:00
Mark Paluch
d4a06a781c #87 - Consistently use RowMetadata.
We now apply row metadata checks also for property population.
2019-05-22 15:50:02 +02:00
Mark Paluch
1c9595f221 #126 - Polishing.
Remove superfluous property.
2019-05-22 15:01:53 +02:00
Mark Paluch
4cba0d5ac3 #126 - Use testcontainers version property.
We now use the version property from Spring Data Build and import testcontainers-bom.
2019-05-22 15:01:53 +02:00
Jens Schauder
ac4e84dc81 #55 - Polishing.
Minor changes to documentation in order to avoid <literal code>``s constructs as recommended by our style guide.

Original pull request: #125.
2019-05-22 14:22:07 +02:00
Mark Paluch
1b63fb634d #55 - Update documentation.
Original pull request: #125.
2019-05-22 14:21:58 +02:00
Mark Paluch
e03d1dc8ee #55 - Polishing.
Original pull request: #125.
2019-05-22 14:21:52 +02:00
Mark Paluch
32f1770529 #55 - Reuse Dialect support provided by Spring Data Relational.
We now reuse the existing Dialect infrastructure provided by Spring Data Relational to enhance it for R2DBC specifics such as bind markers.

Original pull request: #125.
2019-05-22 14:21:43 +02:00
Mark Paluch
46082147d3 #69 - Allow object creation with a subset of columns.
We now allow object creation when not all columns are present by leveraging R2DBC RowMetadata. A column subset is necessary for projections.
2019-05-22 09:41:23 +02:00
Mark Paluch
972bc09606 #122 - Polishing.
Add extension for UpdateTableSpec.table. Add tests. Formatting.

Original pull request: #123.
2019-05-21 15:53:18 +02:00
Jonas Bark
9bcaa24707 #122 - Improve Kotlin extensions for CriteriaStep and DatabaseClient.
Original pull request: #123.
2019-05-21 15:53:08 +02:00
Mark Paluch
8b77aa9431 #89 - Accept SQL directly in DatabaseClient.execute(…) stage.
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.
2019-05-21 14:02:45 +02:00
Ohad Shai
36c4c1d062 #120 - Fix link text for jasync-sql.
Original pull request: #120.
2019-05-19 13:44:58 +02:00
Mark Paluch
5714709d71 #30 - Polishing.
Fix custom converter documentation. Accept custom converters in DefaultReactiveDataAccessStrategy constructor.
2019-05-17 23:28:03 +02:00
Mark Paluch
14e2a3722b #118 - Upgrade to jasync-r2dbc-mysql 0.9.52. 2019-05-15 15:25:03 +02:00
Mark Paluch
d23dcd0d2c #37 - After release cleanups. 2019-05-14 10:39:33 +02:00
Mark Paluch
b7d5091635 #37 - Prepare next development iteration. 2019-05-14 10:39:32 +02:00
Mark Paluch
6ea15325e3 #37 - Release version 1.0 M2. 2019-05-14 10:31:52 +02:00
Mark Paluch
cbead6ea19 #37 - Prepare 1.0 M2. 2019-05-14 10:31:50 +02:00
Mark Paluch
55a6ae0a2a #37 - Updated changelog. 2019-05-14 10:31:49 +02:00
Mark Paluch
430d984503 #109 - Fix simple type conversion for projection queries.
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>.
2019-05-14 09:35:46 +02:00
Mark Paluch
4a46692dfe #117 - Upgrade to jasync-sql 0.9.51. 2019-05-14 09:12:26 +02:00
Oliver Drotbohm
49fb08dc7d #116 - Upgrade to R2DBC 0.8 M8. 2019-05-13 19:43:58 +02:00
Oliver Drotbohm
a5c72a61b4 #115 - Upgrade to Spring Data Moore M4.
Upgraded Spring Data parent, Commons and Relational modules to Moore M4 versions.
2019-05-13 18:22:33 +02:00
Oliver Drotbohm
c456af0d2a #111 - Package and type renames.
Package renames:

- `….domain` -> `….mapping`
- `….function.connectionfactory` -> `connectionfactory`
- `….function.convert` -> `convert`
- `….function.query` -> `query`
- `….function` -> `….core`

Type moves:

- `….dialect.R2dbcSimpleTypeHolder` -> `….mapping.R2dbcSimpleTypeHolder`
- `….mapping.BindTarget` -> `….dialect.BindTarget`
- `….mapping.PreparedOperation` -> `….core.PreparedOperation`
- `….mapping.QueryOperation` -> `….core.QueryOperation`
- `….mapping.BindOperation` -> `….core.BindOperation`
- `….connectionfactory.ConnectionFactoryTransactionManager` -> `….connectionfactory.R2dbcTransactionManager`

That makes us end up with:

- `connectionfactory`
- `core` -> `connectionfactory`, `convert`, `dialect`, `mapping`, `query`
- `query` -> `convert`, `dialect`, `mapping`
- `convert` -> `dialect`, `mapping`
- `dialect` -> `mapping`
- `mapping` -> Spring Data Commons mapping

Reflect type renames in reference documentation.
2019-05-09 18:11:55 +02:00
Christoph Strobl
988b31b33a #107 - Polishing.
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
2019-05-09 08:26:07 +02:00
Mark Paluch
79e32941b5 #107 - Add support for ConnectionFactoryTransactionManager.ConnectionFactoryTransactionManager.
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
2019-05-09 07:56:23 +02:00
Oliver Drotbohm
da53a9a934 #64 - Polishing.
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.
2019-05-08 10:45:30 +02:00
Jens Schauder
361d801b14 #64 - Polishing.
Fixed typos, formatting and minor errors in documentation.

Original pull request: #106.
2019-05-08 10:45:30 +02:00
Mark Paluch
774d2e8b09 #64 - API polishing.
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.
2019-05-08 10:45:30 +02:00
Mark Paluch
ff69a41162 #64 - Split documentation for R2DBC core into parts.
Original pull request: #106.
2019-05-08 10:45:30 +02:00
Mark Paluch
fd4472aaaa #64 - Add Criteria API.
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.
2019-05-08 10:45:30 +02:00
Mark Paluch
88945d7d71 #73 - Introduce BindTarget.
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.
2019-05-06 13:50:36 +02:00
Jens Schauder
02e0cb5026 #73 - Polishing.
Original pull request: #82.
2019-05-06 13:50:33 +02:00
Mark Paluch
ef2d885b1e #73 - Introduce PreparedOperation.
We now encapsulate prepared operations from the StatementFactory within PreparedOperation that renders SQL and provides binding values.

StatementFactory supports SELECT/INSERT/UPDATE/DELETE statement creation considering Dialect-specific rendering.
StatementFactory replaces String-based statement methods in ReactiveDataAccessStrategy.

PreparedOperation<Update> operation = accessStrategy.getStatements().update(entity.getTableName(), binder -> {
	binder.bind("name", "updated value");
	binder.filterBy("id", SettableValue.from(42));
});

databaseClient.execute().sql(operation).then();

Original pull request: #82.
2019-05-06 13:50:20 +02:00