Comments (2)
Thanks for picking up on this loose end. JDBC users want probably a conversion of ?
to $1
/@P1
. We have also another aspect that plays into that which is stream parameter reuse:
conn.createStatement("INSERT INTO names (first_name, last_name) VALUES (:PARAM:, :PARAM:) ")
.bind(":PARAM:", Blob.from(…))
.execute()
In this case, native execution accepts a single blob and translates it into the right result. Bind marker conversion would likely try to consume the Blob
twice if we go for identifiable bind markers. Anonymous bind markers (such as ?
) require users to specify individual items because they correlate by positional occurence.
from r2dbc-proxy.
With current converter API, above bind operation can be translated like this in converter.
Blob blob = Blob.from(...);
stmt.bind("$0", blob);
stmt.bind("$1", blob);
So, single stmt.bind(":PARAM:", Blob.from(…))
can be converted to multiple bind operations - stmt.bind("$0", blob).bind("$1", blob)
.
Or, even query can be translated to INSERT INTO names (first_name, last_name) VALUES ($0,$0)
and bind operation can perform stmt.bind("$0", Blob.from(...))
if driver/database allow such query and operation.
There is interesting aspect in multiple parameter expansion (as above example) with Blob
(or Clob
).
As you mentioned, I think the Blob will be consumed twice. So, this wouldn't work if blob is not able to support multiple read. If driver supports such that blob can be reused in different parameter binding (when same Blob object is passed in different bind
operation), then it would work.
At this converter level, it is still manipulating SPI.
So, after all, it's pretty much on the driver that how much support it has, and the implementation of this converter API transforms the user defined binding operations to the extent that driver can understand by performing pass-through, skip, or modifying originated bind operations.
from r2dbc-proxy.
Related Issues (20)
- Release 1.1.0.RELEASE
- Propagate Contextview to ConnectionInfo and StatementInfo HOT 2
- Upgrade reactor-bom to 2022.0.7
- Upgrade micrometer-bom 1.10.7
- Upgrade micrometer-tracing-bom to 1.0.6
- Release 1.1.1.RELEASE
- Add host and port parameters to ObservationProxyExecutionListener constructor
- Dependency upgrades
- Release 1.1.2.RELEASE
- QueriesExecutionContext::isAllConsumed works different depending on signature of GenericExecuteSpec#map HOT 1
- Consistently handle common methods in callback handlers
- Dependency upgrade for 1.1.3 release
- Release 1.1.3.RELEASE
- Create proxy using HashSet interfaces causing a dynamic ordering that impacts GraalVM metadata consistency HOT 5
- Remove proxy-config.json
- Dependency upgrade for 1.1.4 release
- Release 1.1.4.RELEASE
- Add getters on "ProxyConnectionFactory.Builder"
- Dependency upgrade for 1.1.5 release
- Release 1.1.5.RELEASE
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from r2dbc-proxy.