You will miss many side effects related to syncing and the card browser.
You should use the Python scripting interface to libmnemosyne:
from mnemosyne.script import Mnemosyne
# 'data_dir = None' will use the default system location, edit as
appropriate.
data_dir = None
mnemosyne = Mnemosyne(data_dir)
for tag in mnemosyne.database().tags():
if "::" not in tag.name:
tag.name = tag.name.replace(":", "::")
mnemosyne.database().update_tag(tag)
mnemosyne.finalise()
(Didn't test this script yet, though)
If you're on Linux, you can run this script without doing anything
special. If you're on Windows, let me know and I'll prepare an installer
that installs a copy of Mnemosyne inside your python installation, so
that you can use scripting.
Peter
On 09/16/2012 04:55 PM, Michael Campbell wrote:
Peter,
I'm a programmer by trade and am familiar with sql. If I wanted to do
a bulk update of cards using the sqlite3 binary on the default.db, as
described below, are there any hidden issues that I might run into?
My update is this: My 1.x decks used a hierarchical tagging system
like 2.x supports, but I used ":" as the delimiter. What I would want
to do is change the category of each card by replacing all ":" with
"::".
Something like:
update cards set tags= replace(tags, ':', '::') where <some clause to
find rows that have a tag with a ":" in them...> ;
(Obviously I'd "practice" on a copy of the default.db to make sure I
got the sql right and such)
But my biggest question was, assuming I get the syntax and semantics
correct, are there any hidden issues that I might encounter by simply
changing the category name of everything? Are there foreign keys to
this column, etc?
--
Peter Bienstman
Ghent University, Dept. of Information Technology
Sint-Pietersnieuwstraat 41, B-9000 Gent, Belgium
tel: +32 9 264 34 46, fax: +32 9 264 35 93
WWW: http://photonics.intec.UGent.be
email: [email protected]
--
You received this message because you are subscribed to the Google Groups
"mnemosyne-proj-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit https://groups.google.com/groups/opt_out.