|
5 | 5 | import me.zort.sqllib.SQLConnectionBuilder; |
6 | 6 | import me.zort.sqllib.internal.annotation.NullableField; |
7 | 7 | import me.zort.sqllib.internal.annotation.PrimaryKey; |
| 8 | +import me.zort.sqllib.internal.query.QueryDetails; |
| 9 | +import me.zort.sqllib.internal.query.QueryNode; |
8 | 10 | import me.zort.sqllib.pool.SQLConnectionPool; |
9 | 11 | import me.zort.sqllib.SQLDatabaseConnection; |
10 | 12 | import me.zort.sqllib.SQLDatabaseOptions; |
|
14 | 16 | import me.zort.sqllib.api.provider.Select; |
15 | 17 | import me.zort.sqllib.internal.impl.DefaultSQLEndpoint; |
16 | 18 | import me.zort.sqllib.transaction.TransactionFlow; |
| 19 | +import me.zort.sqllib.util.Pair; |
17 | 20 | import org.apache.logging.log4j.Level; |
18 | 21 | import org.apache.logging.log4j.core.config.Configurator; |
19 | 22 | import org.junit.jupiter.api.*; |
@@ -196,7 +199,16 @@ public void test6_Transactions() { |
196 | 199 | } |
197 | 200 |
|
198 | 201 | @Test |
199 | | - public void test7_Close() { |
| 202 | + public void test7_RawNode() { |
| 203 | + String raw = "SELECT * FROM users WHERE nickname = ?"; |
| 204 | + QueryNode<?> query = QueryNode.fromRawQuery(raw, "User1"); |
| 205 | + Pair<String, Object[]> preparedQuery = query.toPreparedQuery(); |
| 206 | + assertEquals(raw, preparedQuery.getFirst()); |
| 207 | + assertArrayEquals(new Object[]{"User1"}, preparedQuery.getSecond()); |
| 208 | + } |
| 209 | + |
| 210 | + @Test |
| 211 | + public void test8_Close() { |
200 | 212 | System.out.println("Closing connection..."); |
201 | 213 | connection.disconnect(); |
202 | 214 | System.out.println("Connection closed"); |
|
0 commit comments