Skip to content

Introduce PreparedOperation #73

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mp911de opened this issue Mar 18, 2019 · 0 comments
Closed

Introduce PreparedOperation #73

mp911de opened this issue Mar 18, 2019 · 0 comments
Assignees
Labels
type: enhancement A general enhancement
Milestone

Comments

@mp911de
Copy link
Member

mp911de commented Mar 18, 2019

We should introduce a PreparedOperation API in preparation to encapsulate SQL along with value bindings. This is required to migrate off String concatenation towards our Statement Builder API that generated statements and provides binding values.

A PreparedOperation should be able to be executed by DatabaseClient and should be created by a StatementFactory that considers Dialect-specifics and that is able to use the rendering component for statements.

@mp911de mp911de added this to the 1.0 M2 milestone Mar 18, 2019
mp911de added a commit that referenced this issue Mar 18, 2019
mp911de added a commit that referenced this issue Mar 18, 2019
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();
@mp911de mp911de added the type: enhancement A general enhancement label Mar 18, 2019
mp911de added a commit that referenced this issue Mar 22, 2019
mp911de added a commit that referenced this issue Mar 22, 2019
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();
mp911de added a commit that referenced this issue Mar 22, 2019
Switch license header URLs to HTTPS.
mp911de added a commit that referenced this issue Apr 18, 2019
mp911de added a commit that referenced this issue Apr 18, 2019
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();
mp911de added a commit that referenced this issue Apr 18, 2019
Switch license header URLs to HTTPS. Rebase onto master.
mp911de added a commit that referenced this issue May 2, 2019
mp911de added a commit that referenced this issue May 2, 2019
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();
mp911de added a commit that referenced this issue May 2, 2019
Switch license header URLs to HTTPS. Rebase onto master.
schauder added a commit that referenced this issue May 6, 2019
schauder added a commit that referenced this issue May 6, 2019
schauder added a commit that referenced this issue May 6, 2019
schauder added a commit that referenced this issue May 6, 2019
schauder added a commit that referenced this issue May 6, 2019
schauder added a commit that referenced this issue May 6, 2019
mp911de added a commit that referenced this issue May 6, 2019
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.
mp911de pushed a commit that referenced this issue May 6, 2019
Original pull request: #82.
mp911de added a commit that referenced this issue May 6, 2019
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.
@mp911de mp911de self-assigned this May 6, 2019
@mp911de mp911de closed this as completed May 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant