Re: Help understanding acronyms on anki database

555 views
Skip to first unread message

iniju

unread,
Oct 11, 2012, 5:28:58 PM10/11/12
to anki-a...@googlegroups.com, que...@fluidshopping.com
Not sure about all of them, since this is port of libanki and the names were decided by Damien, but the cryptic ones:
crt: created time
ver: collection version
scm: schema version
dty: dirty flag?
usn: universal serial number, used during syncs
dconf: deck configuration

mid: model id
cid: card id
nid: note id
did: deck id
oid: old id
odid: old deck id
ivl: interval
reps: number of repetitions
ord: ordinal?
csum: checksum
flds: fields
odue: old due value

But all this comes from libanki of the anki project, so you're probably better off if you base your analysis on the original.


Cheers
Kostas


On Tuesday, 9 October 2012 20:56:04 UTC+1, urlwolf wrote:
Hi, 
First of all, congrats on ankiDroid 2. I've used ankiDroid since Jan 2011 and the improvements in speed are very noticeable.

I'm considering whether it'd be possible to write a webapp (unrelated to languages) that would interface with anki/ankiDroid. For that, I'm thinking the scheduler algo must be mostly the same. Is this correct?

I'm reading the code. First I want to understand the database. I guess the place to start would be:

private static void _addSchema(AnkiDb db, boolean setColConf) {
        db.execute("create table if not exists 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" + ");");
        db.execute("create table if not exists notes (" + "   id              integer primary key,"
                + "  guid            text not null," + " mid             integer not null,"
                + " mod             integer not null," + " usn             integer not null,"
                + " tags            text not null," + " flds            text not null,"
                + " sfld            integer not null," + " csum            integer not null,"
                + " flags           integer not null," + " data            text not null" + ");");
        db.execute("create table if not exists cards (" + "   id              integer primary key,"
                + "  nid             integer not null," + "  did             integer not null,"
                + "  ord             integer not null," + "  mod             integer not null,"
                + " usn             integer not null," + " type            integer not null,"
                + " queue           integer not null," + "    due             integer not null,"
                + "   ivl             integer not null," + "  factor          integer not null,"
                + " reps            integer not null," + "   lapses          integer not null,"
                + "   left            integer not null," + "   odue            integer not null,"
                + "   odid            integer not null," + "   flags           integer not null,"
                + "   data            text not null" + ");");
        db.execute("create table if not exists 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" + ");");
        db.execute("create table if not exists graves (" + "    usn             integer not null,"
                + "    oid             integer not null," + "    type            integer not null" + ")");
        db.execute("INSERT OR IGNORE INTO col VALUES(1,0,0," +
                Utils.intNow(1000) + "," + Collection.SCHEMA_VERSION +
                ",0,0,0,'','{}','','','{}')");
        if (setColConf) {
            _setColVars(db);
        }
    }

But  the column names don't make any sense to me. They look like acronyms. 
Is this documented anywhere? If no documentation (no worries!) Is there any other way I could guess the names?

Thanks!

Reply all
Reply to author
Forward
Message has been deleted
0 new messages