From 76af79c4faf9eb97aa61e5cfb22173ecbe7216c9 Mon Sep 17 00:00:00 2001
From: Kim Seon Woo <69591622+seonwoo960000@users.noreply.github.com>
Date: Tue, 7 Oct 2025 23:33:02 +0900
Subject: [PATCH] Add javadoc on classes and public methods for publishing to
maven central
---
.github/data/limbo-cargo-output.txt | 222 ------------------
bindings/java/.gitignore | 1 +
.../java/src/main/java/tech/turso/JDBC.java | 11 +
.../java/tech/turso/core/TursoDBFactory.java | 2 +-
.../java/tech/turso/core/TursoResultSet.java | 5 +-
.../java/tech/turso/core/TursoStatement.java | 4 +-
.../tech/turso/jdbc4/JDBC4Connection.java | 40 ++++
.../turso/jdbc4/JDBC4DatabaseMetaData.java | 8 +
.../turso/jdbc4/JDBC4PreparedStatement.java | 10 +
.../java/tech/turso/jdbc4/JDBC4ResultSet.java | 19 ++
.../java/tech/turso/jdbc4/JDBC4Statement.java | 17 ++
.../java/tech/turso/utils/ByteArrayUtils.java | 13 +
12 files changed, 126 insertions(+), 226 deletions(-)
delete mode 100644 .github/data/limbo-cargo-output.txt
diff --git a/.github/data/limbo-cargo-output.txt b/.github/data/limbo-cargo-output.txt
deleted file mode 100644
index 5a33c5fd0..000000000
--- a/.github/data/limbo-cargo-output.txt
+++ /dev/null
@@ -1,222 +0,0 @@
-Benchmarking limbo/Prepare statement: 'SELECT 1'
-Benchmarking limbo/Prepare statement: 'SELECT 1': Warming up for 3.0000 s
-Benchmarking limbo/Prepare statement: 'SELECT 1': Collecting 100 samples in estimated 5.0062 s (2.4M iterations)
-Benchmarking limbo/Prepare statement: 'SELECT 1': Analyzing
-limbo/Prepare statement: 'SELECT 1'
- time: [2.0631 µs 2.0688 µs 2.0763 µs]
- thrpt: [481.63 Kelem/s 483.37 Kelem/s 484.70 Kelem/s]
-Found 13 outliers among 100 measurements (13.00%)
- 1 (1.00%) low severe
- 5 (5.00%) high mild
- 7 (7.00%) high severe
-Benchmarking limbo/Prepare statement: 'SELECT * FROM users LIMIT 1'
-Benchmarking limbo/Prepare statement: 'SELECT * FROM users LIMIT 1': Warming up for 3.0000 s
-Benchmarking limbo/Prepare statement: 'SELECT * FROM users LIMIT 1': Collecting 100 samples in estimated 5.0159 s (1.3M iterations)
-Benchmarking limbo/Prepare statement: 'SELECT * FROM users LIMIT 1': Analyzing
-limbo/Prepare statement: 'SELECT * FROM users LIMIT 1'
- time: [3.9747 µs 3.9842 µs 3.9937 µs]
- thrpt: [250.39 Kelem/s 250.99 Kelem/s 251.59 Kelem/s]
-Found 17 outliers among 100 measurements (17.00%)
- 5 (5.00%) low severe
- 3 (3.00%) low mild
- 3 (3.00%) high mild
- 6 (6.00%) high severe
-Benchmarking limbo/Prepare statement: 'SELECT first_name, count(1) FROM users GROUP BY first_name HAVING count(1)...
-Benchmarking limbo/Prepare statement: 'SELECT first_name, count(1) FROM users GROUP BY first_name HAVING count(1)...: Warming up for 3.0000 s
-Benchmarking limbo/Prepare statement: 'SELECT first_name, count(1) FROM users GROUP BY first_name HAVING count(1)...: Collecting 100 samples in estimated 5.0099 s (500k iterations)
-Benchmarking limbo/Prepare statement: 'SELECT first_name, count(1) FROM users GROUP BY first_name HAVING count(1)...: Analyzing
-limbo/Prepare statement: 'SELECT first_name, count(1) FROM users GROUP BY first_name HAVING count(1)...
- time: [10.220 µs 10.280 µs 10.358 µs]
- thrpt: [96.544 Kelem/s 97.281 Kelem/s 97.846 Kelem/s]
-Found 13 outliers among 100 measurements (13.00%)
- 1 (1.00%) low severe
- 2 (2.00%) high mild
- 10 (10.00%) high severe
-Benchmarking limbo/Execute prepared statement: 'SELECT 1'
-Benchmarking limbo/Execute prepared statement: 'SELECT 1': Warming up for 3.0000 s
-Benchmarking limbo/Execute prepared statement: 'SELECT 1': Collecting 100 samples in estimated 5.0006 s (27M iterations)
-Benchmarking limbo/Execute prepared statement: 'SELECT 1': Analyzing
-limbo/Execute prepared statement: 'SELECT 1'
- time: [181.95 ns 182.33 ns 182.70 ns]
- thrpt: [5.4736 Melem/s 5.4844 Melem/s 5.4960 Melem/s]
-Found 18 outliers among 100 measurements (18.00%)
- 6 (6.00%) low severe
- 3 (3.00%) low mild
- 6 (6.00%) high mild
- 3 (3.00%) high severe
-Benchmarking limbo/Execute prepared statement: 'SELECT * FROM users LIMIT 1'
-Benchmarking limbo/Execute prepared statement: 'SELECT * FROM users LIMIT 1': Warming up for 3.0000 s
-Benchmarking limbo/Execute prepared statement: 'SELECT * FROM users LIMIT 1': Collecting 100 samples in estimated 5.0008 s (4.0M iterations)
-Benchmarking limbo/Execute prepared statement: 'SELECT * FROM users LIMIT 1': Analyzing
-limbo/Execute prepared statement: 'SELECT * FROM users LIMIT 1'
- time: [1.2549 µs 1.2572 µs 1.2594 µs]
- thrpt: [794.03 Kelem/s 795.44 Kelem/s 796.89 Kelem/s]
-Found 15 outliers among 100 measurements (15.00%)
- 6 (6.00%) low severe
- 3 (3.00%) high mild
- 6 (6.00%) high severe
-Benchmarking limbo/Execute prepared statement: 'SELECT * FROM users LIMIT 100'
-Benchmarking limbo/Execute prepared statement: 'SELECT * FROM users LIMIT 100': Warming up for 3.0000 s
-Benchmarking limbo/Execute prepared statement: 'SELECT * FROM users LIMIT 100': Collecting 100 samples in estimated 5.0047 s (4.0M iterations)
-Benchmarking limbo/Execute prepared statement: 'SELECT * FROM users LIMIT 100': Analyzing
-limbo/Execute prepared statement: 'SELECT * FROM users LIMIT 100'
- time: [1.2503 µs 1.2528 µs 1.2560 µs]
- thrpt: [796.20 Kelem/s 798.23 Kelem/s 799.84 Kelem/s]
-Found 14 outliers among 100 measurements (14.00%)
- 2 (2.00%) low severe
- 1 (1.00%) low mild
- 5 (5.00%) high mild
- 6 (6.00%) high severe
-
-Benchmarking rusqlite/Prepare statement: 'SELECT 1'
-Benchmarking rusqlite/Prepare statement: 'SELECT 1': Warming up for 3.0000 s
-Benchmarking rusqlite/Prepare statement: 'SELECT 1': Collecting 100 samples in estimated 5.0010 s (6.5M iterations)
-Benchmarking rusqlite/Prepare statement: 'SELECT 1': Analyzing
-rusqlite/Prepare statement: 'SELECT 1'
- time: [768.58 ns 770.50 ns 772.43 ns]
- thrpt: [1.2946 Melem/s 1.2979 Melem/s 1.3011 Melem/s]
-Found 16 outliers among 100 measurements (16.00%)
- 5 (5.00%) low severe
- 2 (2.00%) low mild
- 1 (1.00%) high mild
- 8 (8.00%) high severe
-Benchmarking rusqlite/Prepare statement: 'SELECT * FROM users LIMIT 1'
-Benchmarking rusqlite/Prepare statement: 'SELECT * FROM users LIMIT 1': Warming up for 3.0000 s
-Benchmarking rusqlite/Prepare statement: 'SELECT * FROM users LIMIT 1': Collecting 100 samples in estimated 5.0083 s (1.6M iterations)
-Benchmarking rusqlite/Prepare statement: 'SELECT * FROM users LIMIT 1': Analyzing
-rusqlite/Prepare statement: 'SELECT * FROM users LIMIT 1'
- time: [3.2006 µs 3.2038 µs 3.2084 µs]
- thrpt: [311.68 Kelem/s 312.13 Kelem/s 312.45 Kelem/s]
-Found 11 outliers among 100 measurements (11.00%)
- 5 (5.00%) low severe
- 1 (1.00%) low mild
- 2 (2.00%) high mild
- 3 (3.00%) high severe
-Benchmarking rusqlite/Execute prepared statement: 'SELECT 1'
-Benchmarking rusqlite/Execute prepared statement: 'SELECT 1': Warming up for 3.0000 s
-Benchmarking rusqlite/Execute prepared statement: 'SELECT 1': Collecting 100 samples in estimated 5.0002 s (82M iterations)
-Benchmarking rusqlite/Execute prepared statement: 'SELECT 1': Analyzing
-rusqlite/Execute prepared statement: 'SELECT 1'
- time: [60.613 ns 60.788 ns 61.098 ns]
- thrpt: [16.367 Melem/s 16.451 Melem/s 16.498 Melem/s]
-Found 8 outliers among 100 measurements (8.00%)
- 1 (1.00%) low mild
- 1 (1.00%) high mild
- 6 (6.00%) high severe
-Benchmarking rusqlite/Execute prepared statement: 'SELECT * FROM users LIMIT 1'
-Benchmarking rusqlite/Execute prepared statement: 'SELECT * FROM users LIMIT 1': Warming up for 3.0000 s
-Benchmarking rusqlite/Execute prepared statement: 'SELECT * FROM users LIMIT 1': Collecting 100 samples in estimated 5.0014 s (4.3M iterations)
-Benchmarking rusqlite/Execute prepared statement: 'SELECT * FROM users LIMIT 1': Analyzing
-rusqlite/Execute prepared statement: 'SELECT * FROM users LIMIT 1'
- time: [1.1686 µs 1.1702 µs 1.1716 µs]
- thrpt: [853.52 Kelem/s 854.55 Kelem/s 855.74 Kelem/s]
-Found 13 outliers among 100 measurements (13.00%)
- 2 (2.00%) low severe
- 1 (1.00%) low mild
- 6 (6.00%) high mild
- 4 (4.00%) high severe
-Benchmarking rusqlite/Execute prepared statement: 'SELECT * FROM users LIMIT 100'
-Benchmarking rusqlite/Execute prepared statement: 'SELECT * FROM users LIMIT 100': Warming up for 3.0000 s
-Benchmarking rusqlite/Execute prepared statement: 'SELECT * FROM users LIMIT 100': Collecting 100 samples in estimated 5.0016 s (4.3M iterations)
-Benchmarking rusqlite/Execute prepared statement: 'SELECT * FROM users LIMIT 100': Analyzing
-rusqlite/Execute prepared statement: 'SELECT * FROM users LIMIT 100'
- time: [1.1643 µs 1.1710 µs 1.1789 µs]
- thrpt: [848.26 Kelem/s 853.98 Kelem/s 858.85 Kelem/s]
-Found 17 outliers among 100 measurements (17.00%)
- 5 (5.00%) low severe
- 3 (3.00%) low mild
- 4 (4.00%) high mild
- 5 (5.00%) high severe
-
- Running unittests src/lib.rs (target/release/deps/limbo_ext-8b70654a7fccf221)
-
-running 0 tests
-
-test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
-
- Running unittests src/lib.rs (target/release/deps/limbo_libsql-66ab9a0ee1a27f4c)
-
-running 1 test
-test params::tests::test_serialize_array ... ignored
-
-test result: ok. 0 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 0.00s
-
- Running unittests src/lib.rs (target/release/deps/limbo_macros-669ce5abb31e687e)
- Running unittests main.rs (target/release/deps/limbo_sim-d28081335520ff9c)
-
-running 0 tests
- Running unittests src/lib.rs (target/release/deps/limbo_sqlite3-1d7f53c447b1fc8a)
- Running unittests src/lib.rs (target/release/deps/limbo_uuid-c0d9c3b2e9e30eee)
-
-test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
-
-
-running 0 tests
-
-test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
-
-
-running 0 tests
-
-test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
-
-
-running 0 tests
-
-test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
-
- Running unittests src/lib.rs (target/release/deps/_limbo-9562557e55b9bbed)
-
-running 0 tests
-
-test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
-
- Running unittests src/lib.rs (target/release/deps/sqlite3_parser-475bbf4de217f28a)
-
-running 38 tests
-test lexer::sql::test::alter_add_column_primary_key ... ignored
-test lexer::sql::test::alter_add_column_unique ... ignored
-test lexer::sql::test::alter_rename_same ... ignored
-test lexer::sql::test::cast_without_typename ... ignored
-test lexer::sql::test::column_specified_more_than_once ... ignored
-test lexer::sql::test::count_named_placeholders ... ignored
-test lexer::sql::test::count_numbered_placeholders ... ignored
-test lexer::sql::test::count_placeholders ... ignored
-test lexer::sql::test::count_unused_placeholders ... ignored
-test lexer::sql::test::create_strict_table_generated_column ... ignored
-test lexer::sql::test::create_strict_table_missing_datatype ... ignored
-test lexer::sql::test::create_strict_table_unknown_datatype ... ignored
-test lexer::sql::test::create_table_with_only_generated_column ... ignored
-test lexer::sql::test::create_table_without_column ... ignored
-test lexer::sql::test::create_table_without_rowid_missing_pk ... ignored
-test lexer::sql::test::create_temporary_table_with_qualified_name ... ignored
-test lexer::sql::test::create_view_duplicate_column_name ... ignored
- Running benches/keyword.rs (target/release/deps/keyword-255a8492c4f11233)
-test lexer::sql::test::create_view_mismatch_count ... ignored
-test lexer::sql::test::delete_order_by_without_limit ... ignored
-test lexer::sql::test::duplicate_column ... ignored
-test lexer::sql::test::extra_comments_between_statements ... ignored
-test lexer::sql::test::extra_semicolons_between_statements ... ignored
-test lexer::sql::test::foreign_key_on_column ... ignored
-test lexer::sql::test::indexed_by_clause_within_triggers ... ignored
-test lexer::sql::test::insert_default_values ... ignored
-test lexer::sql::test::insert_mismatch_count ... ignored
-test lexer::sql::test::missing_join_clause ... ignored
-test lexer::sql::test::natural_join_on ... ignored
-test lexer::sql::test::only_semicolons_no_statements ... ignored
-test lexer::sql::test::qualified_table_name_within_triggers ... ignored
-test lexer::sql::test::selects_compound_mismatch_columns_count ... ignored
-test lexer::sql::test::unknown_table_option ... ignored
-test lexer::sql::test::update_order_by_without_limit ... ignored
-test lexer::sql::test::values_mismatch_columns_count ... ignored
-test lexer::sql::test::vtab_args ... ignored
-test lexer::sql::tests::fallible_iterator ... ignored
-test lexer::sql::tests::invalid_number_literal ... ignored
-test parser::ast::test::test_dequote ... ignored
-
-test result: ok. 0 passed; 0 failed; 38 ignored; 0 measured; 0 filtered out; finished in 0.00s
-
-
-running 0 tests
-
-test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
diff --git a/bindings/java/.gitignore b/bindings/java/.gitignore
index f4f8fc542..ea2eb6d0a 100644
--- a/bindings/java/.gitignore
+++ b/bindings/java/.gitignore
@@ -41,3 +41,4 @@ bin/
### turso builds ###
libs
+temp
\ No newline at end of file
diff --git a/bindings/java/src/main/java/tech/turso/JDBC.java b/bindings/java/src/main/java/tech/turso/JDBC.java
index 9611398d9..360098d91 100644
--- a/bindings/java/src/main/java/tech/turso/JDBC.java
+++ b/bindings/java/src/main/java/tech/turso/JDBC.java
@@ -10,6 +10,9 @@ import tech.turso.jdbc4.JDBC4Connection;
import tech.turso.utils.Logger;
import tech.turso.utils.LoggerFactory;
+/**
+ * Turso JDBC driver implementation.
+ */
public final class JDBC implements Driver {
private static final Logger logger = LoggerFactory.getLogger(JDBC.class);
@@ -24,6 +27,14 @@ public final class JDBC implements Driver {
}
}
+ /**
+ * Creates a new Turso JDBC connection.
+ *
+ * @param url the database URL
+ * @param properties connection properties
+ * @return a new connection instance, or null if the URL is not valid
+ * @throws SQLException if a database access error occurs
+ */
@Nullable
public static JDBC4Connection createConnection(String url, Properties properties)
throws SQLException {
diff --git a/bindings/java/src/main/java/tech/turso/core/TursoDBFactory.java b/bindings/java/src/main/java/tech/turso/core/TursoDBFactory.java
index 0076011e4..900c0f681 100644
--- a/bindings/java/src/main/java/tech/turso/core/TursoDBFactory.java
+++ b/bindings/java/src/main/java/tech/turso/core/TursoDBFactory.java
@@ -23,7 +23,7 @@ public final class TursoDBFactory {
* @param url the URL of the database
* @param filePath the path to the database file
* @param properties additional properties for the database connection
- * @return an instance of {@link tursoDB}
+ * @return an instance of {@link TursoDB}
* @throws SQLException if there is an error opening the connection
* @throws IllegalArgumentException if the fileName is empty
*/
diff --git a/bindings/java/src/main/java/tech/turso/core/TursoResultSet.java b/bindings/java/src/main/java/tech/turso/core/TursoResultSet.java
index fe9d72067..168639674 100644
--- a/bindings/java/src/main/java/tech/turso/core/TursoResultSet.java
+++ b/bindings/java/src/main/java/tech/turso/core/TursoResultSet.java
@@ -57,7 +57,7 @@ public final class TursoResultSet {
}
/**
- * Moves the cursor forward one row from its current position. A {@link tursoResultSet} cursor is
+ * Moves the cursor forward one row from its current position. A {@link TursoResultSet} cursor is
* initially positioned before the first fow; the first call to the method next makes
* the first row the current row; the second call makes the second row the current row, and so on.
* When a call to the next method returns false, the cursor is
@@ -65,6 +65,9 @@ public final class TursoResultSet {
*
*
Note that turso only supports ResultSet.TYPE_FORWARD_ONLY, which means that the
* cursor can only move forward.
+ *
+ * @return true if the new current row is valid; false if there are no more rows
+ * @throws SQLException if a database access error occurs
*/
public boolean next() throws SQLException {
if (!open) {
diff --git a/bindings/java/src/main/java/tech/turso/core/TursoStatement.java b/bindings/java/src/main/java/tech/turso/core/TursoStatement.java
index de4d86e7a..0c15f6586 100644
--- a/bindings/java/src/main/java/tech/turso/core/TursoStatement.java
+++ b/bindings/java/src/main/java/tech/turso/core/TursoStatement.java
@@ -91,8 +91,8 @@ public final class TursoStatement {
private native void _close(long statementPointer);
/**
- * Initializes the column metadata, such as the names of the columns. Since {@link tursoStatement}
- * can only have a single {@link tursoResultSet}, it is appropriate to place the initialization of
+ * Initializes the column metadata, such as the names of the columns. Since {@link TursoStatement}
+ * can only have a single {@link TursoResultSet}, it is appropriate to place the initialization of
* column metadata here.
*
* @throws SQLException if a database access error occurs while retrieving column names
diff --git a/bindings/java/src/main/java/tech/turso/jdbc4/JDBC4Connection.java b/bindings/java/src/main/java/tech/turso/jdbc4/JDBC4Connection.java
index 6841a5cbc..172dd3940 100644
--- a/bindings/java/src/main/java/tech/turso/jdbc4/JDBC4Connection.java
+++ b/bindings/java/src/main/java/tech/turso/jdbc4/JDBC4Connection.java
@@ -9,20 +9,45 @@ import tech.turso.annotations.SkipNullableCheck;
import tech.turso.core.TursoConnection;
import tech.turso.core.TursoStatement;
+/**
+ * JDBC 4 Connection implementation for Turso databases.
+ */
public final class JDBC4Connection implements Connection {
private final TursoConnection connection;
private Map