I've recently purchased a database utility called RazorsSQL to do stuff with my SQL lite database. It isn't cheap - 60 or 70 bucks - but it really makes life easy when dealing with data. I tried it for a month on trial, and got hooked. I tried to go back to free options, but the convenience and lack of hassle was too much for me to live without. Congrats to them for a hella piece of good software.
It comes in handy today, because I've noticed some missing / wrong data in my database of Japanese words and english translations. Actually, it's pretty annoying, because I thought I had fixed them already. So, the first thing I'm going to do is validate that I'm using the up-to-date database in my testing.
So, the first thing I'm going to do is open the database on my Macbook and run a select to see if there any blanks in the English field, something I thought I had eliminated.
select * from all_words where english is null
No results. That's good, I think, because it means the errors I'm finding are probably new ones. But, let's check for blanks as opposed to null.
select * from all_words where english like ''
Nope. How about
select * from all_words where english like ' '
And no. But, wait - that doesn't exclude that the possibility that I simply didn't transfer the most recent copy of the database. Ok, what I can do is copy the sqllite file from the android to some junk folder somewhere on the mac, open it, and run the same statements.
Ok, used adb pull /sdcard/data/mydata . to get it into a junk folder. Now, let's connect to it.
Now,
select * from all_words where english = ''
Ah, Sweet. They show up. That means I didn't get the current version transferred. I've figured that the easiest way to get it installed is to copy the database file into the eclipse project's resource folder, then uninstall and re-install the app. Let's try it.
Owwch. The uninstall completely leave the data in there. That's not good. Well, I did see something about version updates for databases and stuff, so that would work. But, how about the multi-media files? It woudn't be good to leave them hanging around.
Well, for now, just to get this test out of the we, we'll manually delete them. The, check on uninstall.
It's hard to uninstall them. I start the app data directory with a "." so the media files don't show up in the music player. But that means I can't see them, and ls -la doesn't work, where the "a" option shows the "." prefixed files on most unix system.
Well, I stumbled across a way to delete it - rm .*, I think it was.
Ok. Now re-install.
Ok, now just copy back to the junk folder.
And - they're gone. Eeexcelent.
I don't know what I'm going to do about the uninstall problem. But I'm glad I don't have to redo the corrections!
Ok, that's a wrap for this problem!
No comments:
Post a Comment