Database

class mnemosyne.libmnemosyne.database.Database(component_manager)

Interface class describing the functions to be implemented by the actual database classes.

Apart from the basic interface defined here, depending on the situation a database can also implement functions for logging, statistics and syncing (see SQLite_logging.py, SQLite_statistics.py, SQLite_sync.py).

abandon()
add_card(card)
add_card_type(card_type)
add_criterion(criterion)
add_fact(fact)
add_fact_view(fact_view)
add_tag(tag)
add_tag_to_cards_with_internal_ids(tag, _card_ids)
backup()
card(id, is_id_internal)
card_type(id, is_id_internal)
card_types_in_use()
cards_due_for_ret_rep(now, sort_key='', limit=-1)
cards_from_fact(fact)

Return a list of the cards deriving from a fact.

cards_learn_ahead(now, sort_key='', limit=-1)
cards_new_memorising(grade, sort_key='', limit=-1)
cards_to_relearn(grade, sort_key='', limit=-1)
cards_unseen(sort_key='', limit=-1)
cards_with_scheduler_data(scheduler_data, sort_key='', limit=-1)
criteria()
criterion(id, is_id_internal)
current_criterion()
deactivate()
delete_card(card)
delete_card_type(card_type)
delete_criterion(criterion)
delete_fact(fact)
delete_fact_view(fact_view)
delete_tag(tag)
delete_tag_if_unused(tag)
display_name()

Returns bare name of the database, without parent paths and without extension.

duplicates_for_fact(fact, card_type)

Return facts with same ‘card_type.unique_fact_keys’ data as ‘fact’.

fact(id, is_id_internal)
fact_view(id, is_id_internal)
get_or_create_tag_with_name(name)
get_or_create_tags_with_names(names)
is_empty()
is_loaded()
load(path)
name()

Returns name of the database, without parent paths, but with extensions.

new(path)
path()

Returns full path of the database.

release_connection()

Release the connection, so that it may be recreated in a separate thread.

remove_tag_from_cards_with_internal_ids(tag, _card_ids)
restore(path)
save(path=None)
scheduler_data_count(scheduler_data)
set_current_criterion(criterion)
set_scheduler_data(scheduler_data)
set_user_id(user_id)
tag(id, is_id_internal)
tags()
tags_from_cards_with_internal_ids(_card_ids)
unload()
update_card(card, repetition_only=False)
update_card_type(card_type)
update_criterion(criterion)
update_fact(fact)
update_fact_view(fact_view)
update_tag(tag)
user_id()

Previous topic

Configuration

Next topic

FileFormat

This Page