-
Notifications
You must be signed in to change notification settings - Fork 7
/
doc.go
91 lines (90 loc) · 3.58 KB
/
doc.go
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
// Copyright: Jonathan Hall
// License: GNU AGPL, Version 3 or later; http://www.gnu.org/licenses/agpl.html
// Package anki provides a library to read *.apkg files produced by Anki
// (http://ankisrs.net/).
//
// A *.apkg file is simply a zip-compressed archive, which contains a the
// following files:
//
// - collection.anki2 -- An SQLite3 database
// - media -- A JSON blob mapping media file filenames to numbers
// - [files numbered 0..n] -- Media files (referenced in the media file above)
//
// The SQLite3 Database contains the following tables. Detailed explanations
// of each column's use can be found inline below, in the struct definitions.
//
// CREATE TABLE col (
// id integer primary key,
// crt integer not null,
// mod integer not null,
// scm integer not null,
// ver integer not null,
// dty integer not null,
// usn integer not null,
// ls integer not null,
// conf text not null,
// models text not null,
// decks text not null,
// dconf text not null,
// tags text not null
// );
//
// CREATE TABLE notes (
// id integer primary key, /* 0 */
// guid text not null, /* 1 */
// mid integer not null, /* 2 */
// mod integer not null, /* 3 */
// usn integer not null, /* 4 */
// tags text not null, /* 5 */
// flds text not null, /* 6 */
// sfld integer not null, /* 7 */
// csum integer not null, /* 8 */
// flags integer not null, /* 9 */
// data text not null /* 10 */
// );
//
// CREATE TABLE cards (
// id integer primary key, /* 0 */
// nid integer not null, /* 1 */
// did integer not null, /* 2 */
// ord integer not null, /* 3 */
// mod integer not null, /* 4 */
// usn integer not null, /* 5 */
// type integer not null, /* 6 */
// queue integer not null, /* 7 */
// due integer not null, /* 8 */
// ivl integer not null, /* 9 */
// factor integer not null, /* 10 */
// reps integer not null, /* 11 */
// lapses integer not null, /* 12 */
// left integer not null, /* 13 */
// odue integer not null, /* 14 */
// odid integer not null, /* 15 */
// flags integer not null, /* 16 */
// data text not null /* 17 */
// );
//
// CREATE TABLE graves (
// usn integer not null,
// oid integer not null,
// type integer not null
// );
//
// CREATE TABLE revlog (
// id integer primary key,
// cid integer not null,
// usn integer not null,
// ease integer not null,
// ivl integer not null,
// lastIvl integer not null,
// factor integer not null,
// time integer not null,
// type integer not null
// );
//
// When it is obvious that a column is no longer used by Anki, it is ommitted
// from these Go data structures. When it is not obvious, it is included, but
// typically with a comment to the effect that its use is unknown. If you know
// of any inaccuracies or recent changes to the Anki schema, please create an
// issue.
package anki