-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathtest_debug.ps1
More file actions
36 lines (32 loc) · 977 Bytes
/
test_debug.ps1
File metadata and controls
36 lines (32 loc) · 977 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Quick debug test for query execution
$code = @'
using SharpCoreDB;
using System;
using System.Linq;
var db = new Database();
db.ExecuteSQL("CREATE TABLE users (id INTEGER PRIMARY KEY, email TEXT)");
db.ExecuteSQL("INSERT INTO users VALUES (1, 'test@example.com')");
Console.WriteLine("Testing SELECT with @ in string literal:");
var result = db.ExecuteQuery("SELECT * FROM users WHERE email = 'test@example.com'");
Console.WriteLine($"Result count: {result.Count}");
if (result.Count > 0)
{
Console.WriteLine($"Email: {result[0]["email"]}");
}
else
{
Console.WriteLine("ERROR: No results returned!");
}
Console.WriteLine("\nTesting UNIXEPOCH function:");
var result2 = db.ExecuteQuery("SELECT UNIXEPOCH('2000-01-01T00:00:00') AS ts");
Console.WriteLine($"Result count: {result2.Count}");
if (result2.Count > 0)
{
Console.WriteLine($"Timestamp: {result2[0]["ts"]}");
}
else
{
Console.WriteLine("ERROR: No results returned!");
}
'@
dotnet-script eval $code