-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
34 lines (33 loc) · 1.18 KB
/
Program.cs
File metadata and controls
34 lines (33 loc) · 1.18 KB
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
using System.Data.SQLite;
namespace System.Data.SQLite2.Test
{
internal class Program
{
static void Main(string[] args)
{
var builder = new SQLiteConnectionStringBuilder();
builder.DataSource = "test.db";
using (var conn = new SQLiteConnection(builder.ToString()))
using (var comand = conn.CreateCommand())
{
conn.Open();
try
{
//conn.EnableExtensions(true);
//conn.LoadExtension("e_sqlite3.dll", "sqlite3_fts5_init");
}
catch (Exception ex)
{
Console.WriteLine($"sqlite3_fts5_init load failed: {ex}");
}
comand.CommandText = "SELECT rowid, title, content FROM docs WHERE docs MATCH 'search'";
using (var reader = comand.ExecuteReader())
while (reader.Read())
{
Console.WriteLine($"{reader.GetString(1)} - {reader.GetString(2)}");
}
}
Console.ReadKey();
}
}
}