-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathColRepository.cs
More file actions
48 lines (42 loc) · 1.37 KB
/
ColRepository.cs
File metadata and controls
48 lines (42 loc) · 1.37 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
using AnkiNet.CollectionFile.Database.Model;
using Microsoft.Data.Sqlite;
namespace AnkiNet.CollectionFile.Database;
internal class ColRepository : SqliteRepository<col>
{
public ColRepository(SqliteConnection connection) : base(connection)
{
}
protected override string TableName => "[col]";
protected override IReadOnlyList<string> Columns { get; } =
[
"[id]", "[crt]", "[mod]", "[scm]", "[ver]",
"[dty]", "[usn]", "[ls]", "[conf]", "[models]",
"[decks]", "[dconf]", "[tags]"
];
protected override IReadOnlyList<object> GetValues(col i)
{
return [
i.id, i.crt, i.mod, i.scm, i.ver,
i.dty, i.usn, i.ls, i.conf, i.models,
i.decks, i.dconf, i.tags
];
}
protected override col Map(SqliteDataReader reader)
{
return new col(
reader.Get<long>("id"),
reader.Get<long>("crt"),
reader.Get<long>("mod"),
reader.Get<long>("scm"),
reader.Get<long>("ver"),
reader.Get<long>("dty"),
reader.Get<long>("usn"),
reader.Get<long>("ls"),
reader.Get<string>("conf"),
reader.Get<string>("models"),
reader.Get<string>("decks"),
reader.Get<string>("dconf"),
reader.Get<string>("tags")
);
}
}