## Purpose
* Implement JDBC4 stream binding methods in JDBC4PreparedStatement for
the following overloads:
* `setAsciiStream(int, InputStream, long)`, `setAsciiStream(int,
InputStream)`
* `setBinaryStream(int, InputStream, long)`, `setBinaryStream(int,
InputStream)`
## Changes
### In `(int, InputStream, long)` methods
* Added a shared helper method `requireLengthIsPositiveInt(long length)`
to validate stream length.
* Validates `length` to fit SQLite’s 32-bit limit for compatibility
with SQLite/Turso engines.
* After validation passes, delegates to the `(int, InputStream, int)`
overload for actual binding logic.
### In `(int, InputeStream)` methods - no length
* Added a shared helper method `readBytes(InputStream x)`.
* Reads the first byte before allocating the buffer to avoid
unnecessary memory allocation for empty streams.
* After reading, directly binds the data using` bindText()` (for ASCII)
or `bindBlob()` (for binary).
* Avoids re-wrapping the stream or reallocation since the byte array
is already available.
## Related Issue
* #615
Reviewed-by: Kim Seon Woo (@seonWKim)
Closes#3937
This PR implements basic support for partial sync. Right now the scope
is limited to only `:memory:` IO and later will be properly expanded to
the file based IO later.
The main addition is `PartialDatabaseStorage` which make request to the
remote server for missing local pages on demand.
The main change is that now tursodatabase JS bindings accept optional
"external" IO event loop which in case of sync will drive `ProtocolIo`
internal work associated with remote page fetching tasks.
Closes#3931
## Purpose
* Implement `setAsciiStream(int, InputStream, int)`,
`setUnicodeStream(int, InputStream, int)`, and `setBinaryStream(int,
InputStream, int)` methods in JDBC4PreparedStatemen
## Changes
* `setAsciiStream(int, InputStream, int)`: Reads ASCII bytes, converts
to `String` using `US_ASCII` and binds with `bindText()`.
* `setUnicodeStream(int, InputStream, int)`: Reads bytes as `UTF-8`
encoded text and binds with `bindText()`.
* `setBinaryStream(int, InputStream, int)`: Reads raw bytes and binds
with `bindBlob()`.
* Added consistent error handling and validation
* null stream - `bindNull()`
* Negative length - throws `SQLException`
* Empty stream - Empty String or Empty Array
* I/O errors - throw `SQLException`
* Ensures consistency between `setXxxStream` and `getXxxStream` methods,
so data written and read use the same encoding.
## Related Issue
* #615
Reviewed-by: Kim Seon Woo (@seonWKim)
Closes#3917
## Purpose
* Implement `setObject(int, Object)` to support binding of common Java
types to SQL parameters in JDBC4.
* This implementation currently covers only standard JDBC4 supported
types. LOB and stream bindings are not yet implemented.
## Changes
* Implemented JDBC4PreparedStatement#setObject(int, Object) handling for
* `String`, `Integer`, `Long`, `Boolean`, `Double`, `Float`, `Byte`,
`Short`
* `byte[]`, `Date`, `Time`, `Timestamp`, `BigDecimal`
* Added validation for unsupported types (`Blob`, `Clob`, `InputStream`,
`Reader`)
* Added corresponding unit test `testSetObjectCoversAllSupportedTypes`
to verify correctness
## Note
* Additional work (e.g., LOB/Stream handling) will be addressed
separately once driver support is available.
## Related Issue
#615
Reviewed-by: Kim Seon Woo (@seonWKim)
Closes#3864