Commit Graph

1091 Commits

Author SHA1 Message Date
Pekka Enberg
cdd9ec3438 Merge 'bindings/java: Implement setObject(int, Object) in JDBC4PreparedStatement' from Orange banana
## 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
2025-10-31 17:00:31 +02:00
Orange flavored banana
5fef79d9f6 feat(jdbc): remove unnecessary java.sql prefixes in setObject 2025-10-31 10:38:30 +09:00
Pekka Enberg
331ba14e7c Turso 0.3.0 2025-10-30 18:16:12 +02:00
Pekka Enberg
c91b66ba38 Turso 0.3.0-pre.7 2025-10-30 18:15:14 +02:00
Orange flavored banana
4cd007f2eb Test(jdbc): Add coverage for setObject(int, Object) 2025-10-30 15:35:31 +09:00
Orange flavored banana
53ab453015 Feat(jdbc): Implement setObject(int, Object) in JDBC4PreparedStatement 2025-10-30 09:54:42 +09:00
Pekka Enberg
84a367b00e Merge 'Implement wasNull tracking in ResultSet getter methods' from 김민석
## Summary
Implemented comprehensive wasNull tracking and refactored getter methods
in JDBC4ResultSet to ensure JDBC specification compliance and improve
code maintainability.
### Changes
Added wasNull tracking to all getter methods: Covers primitive types,
objects, dates/times, streams, and BigDecimal
Refactored columnLabel getters to use delegation pattern: Eliminates
code duplication and ensures consistent wasNull behavior
### Bug Fixes & Code Quality
- Fixed getString(String) to return null instead of empty string for
null values
- Added @Nullable annotation to getBytes(String) to fix NullAway error
- Preserved String parsing in getDate(String) for TEXT-formatted dates
- Extracted timezone offset calculation to helper method
### Testing
Added comprehensive tests for wasNull tracking, columnLabel getters,
stream methods, and null handling

Closes #3838
2025-10-29 18:10:42 +02:00
Pekka Enberg
50ad2f801a Turso 0.3.0-pre.6 2025-10-29 17:54:10 +02:00
Nikita Sivukhin
9e04687108 add one more test 2025-10-29 16:24:05 +04:00
Nikita Sivukhin
e5b11a3278 uncomment tests 2025-10-29 16:24:05 +04:00
Nikita Sivukhin
e27b0d5d6b add more tests 2025-10-29 16:24:05 +04:00
Nikita Sivukhin
b01cec2ba4 wip 2025-10-29 16:24:05 +04:00
Nikita Sivukhin
7e63135abb reset statement after execution 2025-10-29 16:24:05 +04:00
Pekka Enberg
067c4f624b Turso 0.3.0-pre.5 2025-10-28 14:49:34 +02:00
Pekka Enberg
76da008bc2 Merge 'bindings/rust: Enable mimalloc as global allocator' from Pekka Enberg
This improves performance by using mimalloc for memory allocation in the
Rust bindings.

Closes #3839
2025-10-28 14:49:02 +02:00
Nikita Sivukhin
299533b7b6 hide custom modules syntax behind --experimental-custom-modules flag 2025-10-27 12:29:05 +04:00
kimminseok
2b456ec7e4 chore: apply spotless formatting 2025-10-27 00:31:49 +09:00
Pekka Enberg
2429159e5d bindings/rust: Enable mimalloc as global allocator
This improves performance by using mimalloc for memory allocation in the
Rust bindings.
2025-10-26 16:55:33 +02:00
김민석
24181ad307 Merge branch 'main' into feature/result-set-was-null 2025-10-26 23:02:36 +09:00
kimminseok
17f1a070ed Add comprehensive tests for ResultSet getter methods 2025-10-26 22:37:47 +09:00
kimminseok
71f53b5850 Add wasNull tracking to getObject methods 2025-10-26 22:36:38 +09:00
kimminseok
27233a947f Add consistent wasNull handling for stream getter methods 2025-10-26 22:34:43 +09:00
kimminseok
7ee339a754 Extract timezone offset calculation to helper method 2025-10-26 22:09:47 +09:00
kimminseok
791e19892d Refactor columnLabel getters to use delegation pattern 2025-10-26 21:45:54 +09:00
kimminseok
5f10e647e3 Fix wasNull not being set in getter methods 2025-10-26 21:31:11 +09:00
Pekka Enberg
30d183c58f bindings/javascript: Improve open error messages
Include database path name for debuggability.
2025-10-23 19:42:01 +03:00
Pekka Enberg
b984ddf98f Turso 0.3.0-pre.4 2025-10-22 13:42:52 +03:00
Nikita Sivukhin
948bd557cd use simsimd for dense operations 2025-10-21 14:59:01 +04:00
Bob Peterson
5d7b057b8a Enable turso_stress to run in Miri
antithesis_sdk needs to have default features disabled in the workspace
so turso_stress is free to select the noop implementation for Miri
2025-10-20 22:50:44 -05:00
Pekka Enberg
3020966fbd Turso 0.3.0-pre.3 2025-10-17 11:08:36 +03:00
Jussi Saurio
44fa0a4f6e Merge 'bindings/rust: propagate the DropBehavior of a dropped tx to next access of DB, instead of panicing' from Jussi Saurio
Closes #3748
Right now if any error happens during an interactive tx that causes the
`Transaction` to drop, the program will panic.
To prevent this, we store the `DropBehavior` of the transaction on the
`Connection` when it drops and issue the corresponding action (ROLLBACK
/ COMMIT / IGNORE / PANIC) the next time `Connection` is used to access
the database. This defaults to `IGNORE`.
I don't know how good this solution is, but we can at least prevent a
panic by storing whether the connection has a dangling transaction and
roll it back automatically the next time the connection tries to do
something.

Reviewed-by: Preston Thorpe <preston@turso.tech>

Closes #3750
2025-10-16 17:18:31 +03:00
Jussi Saurio
a1b6eafd03 Merge 'Fix: rolling back tx on Error should set autocommit to true' from Jussi Saurio
Rolling back a transaction on Error should result in
`connection.auto_commit` being set back to true.
Added a regression test for this where a UNIQUE constraint violation
rolls back the transaction and trying to COMMIT will fail.
Currently, our default conflict resolution strategy is ROLLBACK, which
ends the transaction. In SQLite, the default is ABORT, which rolls back
the current statement but allows the transaction to continue.
We should migrate to default ABORT once we support subtransactions.
Closes #3746

Reviewed-by: Preston Thorpe <preston@turso.tech>

Closes #3747
2025-10-16 16:55:54 +03:00
Jussi Saurio
7728f3ab58 Update DropBehavior related documentation to reflect reality 2025-10-16 16:40:02 +03:00
Jussi Saurio
3929322061 Propagate DropBehavior to dangling_tx so DropBehavior makes sense 2025-10-16 16:38:42 +03:00
Jussi Saurio
455f0fbc46 Set in_progress to false AFTER executing the statement 2025-10-16 15:53:58 +03:00
Jussi Saurio
d77dd8400d bindings/rust: rollback dangling tx on next access of DB, instead of panicing
Closes #3748

Right now if any error happens during an interactive tx that causes the
`Transaction` to drop, the program will panic.

I don't know how good this solution is, but we can at least prevent a panic
by storing whether the connection has a dangling transaction and roll it back
automatically the next time the connection tries to do something.
2025-10-16 15:44:44 +03:00
Jussi Saurio
213af28cf3 rust bindings: make Statement::query:row() finish execution
otherwise the statement will be considered to be in progress,
and its Drop implementation will roll back the transaction it
is in.
2025-10-16 14:03:17 +03:00
Jussi Saurio
6f1bda1438 Instrument test_drop() with tracing 2025-10-16 14:01:54 +03:00
Jussi Saurio
4de36d28e6 deps: add tracing to rust bindings 2025-10-16 14:00:26 +03:00
Pekka Enberg
e9c0fdcb4b Turso 0.3.0-pre.2 2025-10-16 11:31:30 +03:00
pedrocarlo
818a68b3dd ignore busy errors for test_concurrent_unique_constraint_regression 2025-10-14 12:33:36 -03:00
pedrocarlo
23380a58d7 make next truly async and non blocking 2025-10-14 12:33:36 -03:00
pedrocarlo
943ade7293 pass waker to completion for more efficient task scheduling 2025-10-14 12:33:36 -03:00
Pekka Enberg
9822fc2c90 Merge 'bindings/rust: Bump version recommendation to 0.2' from Kyle Kelley
Bump version number for crate docs starter setup

Closes #3711
2025-10-14 09:32:07 +03:00
pedrocarlo
5b2cce946a do not reference workspace package by path 2025-10-13 21:07:15 -03:00
Kyle Kelley
f7ba978701 Recommend 0.2 in rust bindings
Bump version number for crate docs starter setup
2025-10-13 09:33:58 -07:00
Pekka Enberg
fb1042187b Turso 0.3.0-pre.1 2025-10-10 19:25:58 +03:00
Pekka Enberg
12783ef01e Merge 'bindings/java: Add support for publishing to Maven Central' from Kim Seon Woo
## Purpose
- Deploy `tech.turso:turso:<version>` to maven central so that users can
easily use java bindings
  - For example :
https://repo1.maven.org/maven2/io/github/seonwkim/turso/0.0.1/
## Requirements
- [x] Add the following github secrets.
  - [x] MAVEN_CENTRAL_USERNAME
  - [x] MAVEN_CENTRAL_PASSWORD
  - [x] GPG_PRIVATE_KEY
  - [x] GPG_PASSPHRASE
- [ ] Namespace `tech.turso` must be registered at maven central
- [ ] GPG key registration to key servers
- Notes
  - Retrieve MAVEN_CENTRAL_USERNAME and MAVEN_CENTRAL_PASSWORD from
[maven central](https://central.sonatype.com/usertoken)
  - GPG keys should be registered. You should distribute your keys to
designated(maven central supported) servers
    -  Refer to [GPG key related docs](https://central.sonatype.org/publ
ish/requirements/gpg/#distributing-your-public-key)
    - Btw, I used `keyserver.ubuntu.com` key server while testing
### [Maven Central Username &
Password](https://central.sonatype.com/usertoken)
<img width="2878" height="1338" alt="image"
src="https://github.com/user-
attachments/assets/03e6f967-a7f6-46b8-aef5-d15772bd9eea" />
### [Maven Central
Namespace](https://central.sonatype.com/publishing/namespaces)
<img width="1424" height="456" alt="image" src="https://github.com/user-
attachments/assets/8c0f4f17-bf5a-4c6a-bc47-748d86cd1f1a" />
## Future Works
- Currently, we depend on gradle.properties to determine the version of
our dependency and it's cumbersome to always change the version
manually. Let's find a better solution.

Closes #3624
2025-10-10 13:12:01 +03:00
Jussi Saurio
f9f8eda3c3 Merge 'add Calendar-based timezone conversion support in JDBC4ResultSet' from 김민석
## Summary
Implemented Calendar-based Date/Time/Timestamp getter methods in
JDBC4ResultSet to support timezone conversions.
## Changes
- Implemented `getDate(int, Calendar)` and `getDate(String, Calendar)`
- Implemented `getTime(int, Calendar)` and `getTime(String, Calendar)`
- Implemented `getTimestamp(int, Calendar)` and `getTimestamp(String,
Calendar)`
- Fixed timezone conversion logic (changed from subtraction to addition)
- Added comprehensive test cases for all implemented methods
Test Results
- All tests passed successfully
- New tests validate timezone conversion with UTC and Seoul (UTC+9)

Reviewed-by: Kim Seon Woo (@seonWKim)

Closes #3607
2025-10-09 12:52:09 +03:00
kimminseok
76320e82db lint issues with spotless 2025-10-09 11:19:29 +09:00