mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-25 20:14:21 +01:00
Add TODOs
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user