Add TODOs

This commit is contained in:
김선우
2025-01-18 09:08:43 +09:00
parent 5b9a158db1
commit 39245f35cc
4 changed files with 39 additions and 15 deletions

View File

@@ -34,7 +34,9 @@ public abstract class LimboStatement {
// TODO
}
// TODO: enhance
// TODO: associate the result with CoreResultSet
// TODO: we can make this async!!
// TODO: distinguish queries that return result or doesn't return result
protected List<Object[]> execute(long stmtPointer) throws SQLException {
List<Object[]> result = new ArrayList<>();
while (true) {

View File

@@ -0,0 +1,36 @@
package org.github.tursodatabase;
import org.github.tursodatabase.jdbc4.JDBC4Connection;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Properties;
public class IntegrationTest {
private JDBC4Connection connection;
@BeforeEach
void setUp() throws Exception {
String filePath = TestUtils.createTempFile();
String url = "jdbc:sqlite:" + filePath;
connection = new JDBC4Connection(url, filePath, new Properties());
}
@Test
void create_table_multi_inserts_select() throws Exception {
Statement stmt = createDefaultStatement();
stmt.execute("CREATE TABLE users (id INT PRIMARY KEY, username TEXT);");
stmt.execute("INSERT INTO users VALUES (1, 'seonwoo');");
stmt.execute("INSERT INTO users VALUES (2, 'seonwoo');");
stmt.execute("INSERT INTO users VALUES (3, 'seonwoo');");
stmt.execute("SELECT * FROM users");
}
private Statement createDefaultStatement() throws SQLException {
return connection.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, ResultSet.CLOSE_CURSORS_AT_COMMIT);
}
}

View File

@@ -60,16 +60,4 @@ class JDBC4ConnectionTest {
void prepare_simple_create_table() throws Exception {
connection.prepare("CREATE TABLE users (id INT PRIMARY KEY, username TEXT)");
}
@Test
void exec_simple_create_table() throws Exception {
Statement stmt = createDefaultStatement();
stmt.execute("CREATE TABLE users (id INT PRIMARY KEY, username TEXT);");
stmt.execute("INSERT INTO users VALUES (1, 'seonwoo');");
stmt.execute("SELECT * FROM users;");
}
private Statement createDefaultStatement() throws SQLException {
return connection.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, ResultSet.CLOSE_CURSORS_AT_COMMIT);
}
}