Database question for Saku

11 posts / 0 new
Last post
KW2P
Database question for Saku

I'm still a new user, but let me say first that the more I use CQRlog, the more I like it.

I have a question. I have several logs and one of them has a problem I want to fix. It's log number 005. A couple of weeks ago, I made a dumb mistake when importing contacts and the my_loc fields are wrong in all 550 rows. They all want to be changed to the same locator, EL96tr.

If you were faced with this problem, would you:

1) Use the SQL interface and code up the fix directly?

2) Export to ADIF and edit using and ADIF editor like ADIF Master, then re-import?

3) Export to CSV and edit with a spreadsheet, then re-import from CSV?

My inclination is to use the SQL interface, but I'm not clear on how to specify which log to modify. I don't want to apply the change to all my logs, just log number 005.

Thank you again for all that you do! KW2P, Phil

ei6kw (not verified)
In qso window you can select

In qso window you can select qsos needed to correct, then select edit qso and you will be able to correct any field.

KW2P
Hello, Slav! Thank you. I've

Hello, Slav! Thank you. I've never been able to select ranges of QSOs in the QSO list. I can click a single QSO. I can Ctrl-click to add more QSOs to the selection. But, Shift-click to select a range doesn't work. Since I want to change 550 QSOs (all the QSOs in that log), I was looking for a more elegant way than clicking 550 times and hoping I don't make a mistake. Hahahaha. ;-)

VY 73 de Phil

ei6kw (not verified)
Hi Phil,

Hi Phil,
Strange as shift with down arrow working fine for me. You can also use "select all records" icon in the top rowof qso list window. If 550 records will be too much you can use filter.

oh1kh
My_locator change

Hi Phil !

As Slav says in NewQSO/Window/QSO list you can select what qsos to change. All (the whole log), selected qsos (Select with mouse click while keeping Ctrl key down), or make filter (F12 or QSO list/filter/Create).

After qsos are selected open group edit (QSO list/File/Group edit)
Select "field" as "My localtor" and type locator in "value filed". Then press Apply button.
In your case, if you want "my locator" to be same in whole log you do not need to select qsos. You can change all qso records to have your new "my locator" also the ones that already have correct locator.

How ever before doing all this make full copy of your log. Either with full ADIF export, or copying ~/.config/cqrlog folder with all files and subfolders.

Group edit does not have Cancel. Once you have pressed Apply the change can NOT be undone

--
Saku
OH1KH

KW2P
Hmm. Given what you and Slav

Hmm. Given what you and Slav have said, I think I need to explore the UI some more.

Thank you both, Phil

KW2P
Selecting ranges

Well, that worked. I hadn't noticed the Select All button. I was looking for a Select All function in the menus, where UI standards require that it to be.

Ctrl-arrow also works but for selecting hundreds of records, it's tedious.

The accepted paradigm for dealing with selecting ranges in lists is to click on the first record in the range, then Shift-click on the last record. Those two records and all intervening records are then selected, whether it's 5 or 5,000. (Try this on any spreadsheet or word processor.)

Fortunately, in my case, I wanted to select all records, so the button worked fine. In normal usage of a log, selecting ranges of QSOs is probably an edge case. It's only because I was correcting a mistake I made, that I even encountered the need. This will probably never come up again.

Thank you again! Problem solved.

oh1kh
Selecting ranges

Hi!

Perhaps I did not express it clearly. When you want to make Group edit to all qso records there is no need to select or filter anything.
As default Group Edit will affect to whole log when no selection or filtering is done.

In very latest version (compiled from source > Nov 2020) Group edit is a bit more informative and tells what records the edit will change.

Selecting with Ctrl+LeftClick or arrow keys is suitable only for selecting a couple of qsos.
It also does not take effect in all commands.
Normal way to select a group of qsos is to use Filter (F12) that has many options to use for filtering.

--
Saku
OH1KH

KW2P
Understood. I get it.

Understood. I get it.

All is working well now.

The next task is integrating CQRlog with eQSL and LotW. That should be lots of fun. Hahaha.

Thank you!

PS. While I have you, here's another question. I presume that all the logs live in one single MariaDB database, and the appearance of separate logs is created by having a column that contains the name of the log. Simple. Here's the question:

If I have a log open and I use the SQL console, does it affect the entire database and all the logs at once or do you have code that inserts (forces) the name of the log, and limits the SQL to affecting just that one log. The latter is, of course, better, to prevent dumb mistakes that damage everything. (I think.)

The reason I ask is that if I use the SQL console, I'd want it limited to just the log that's "open", but I can't see how to specify that. That's why I was wondering if you have code that forces that field for me.

(I hope the above makes sense.)

Thanks again.
Phil

oh1kh
Selecting ranges

HI Phill!
Every log you make will live in it's own database. "cqrlogXXX" where XXX is the log number. Then there is common database having things that are not log depended.

If you have chosen "save data to local machine" your databases are in folder ~/.config/cqrlog/database and cqrlog will start a new mysql_safe server for them that is accessed via socket file by cqrlog (.~/.config/cqrlog/database/sock It exists only when cqrlog is running)
If you do not select that you can use mysql server already running in local machine at port 3306 (the usual mysql port). That case you have to make database user for cqrlog and grant privileges to it for using database server.

When using the first choice backups are easy. Just stop cqrlog can copy ~/.config/cqrlog with all files and subfolders. Using the "real" mysql server (the last choice) you have to do backups with mysqldump.
Making full ADIF export from log does not save all your log information and settings, just qso data.


MariaDB [(none)]> show databases like "cqr%";
+-----------------+
| Database (cqr%) |
+-----------------+
| cqrlog001 |
| cqrlog002 |
| cqrlog003 |
| cqrlog004 |
| cqrlog005 |
| cqrlog006 |
| cqrlog007 |
| cqrlog008 |
| cqrlog_common |
+-----------------+
9 rows in set (0.001 sec)

MariaDB [(none)]> show tables in cqrlog_common;
+-------------------------+
| Tables_in_cqrlog_common |
+-------------------------+
| bands |
| db_version |
| dxcc_ref |
| dxclusters |
| iota_list |
| log_list |
| qslmgr |
+-------------------------+
7 rows in set (0.001 sec)

MariaDB [(none)]> show tables in cqrlog001;
+---------------------------------+
| Tables_in_cqrlog001 |
+---------------------------------+
| call_alert |
| club1 |
| club2 |
| club3 |
| club4 |
| club5 |
| cqrlog_config |
| cqrlog_main |
| db_version |
| dxcc_id |
| freqmem |
| log_changes |
| long_note |
| notes |
| profiles |
| upload_status |
| version |
| view_cqrlog_main_by_callsign |
| view_cqrlog_main_by_qsodate |
| view_cqrlog_main_by_qsodate_asc |
| zipcode1 |
| zipcode2 |
| zipcode3 |
+---------------------------------+
23 rows in set (0.001 sec)

At ~/.config/cqrlog there are some files that have configurations:
cqrlog_login.cfg Holds the information about how to open databases at program start.

Xlocal.cfg Holds information about some settings you have chosen to be saved to local machine (you can have cqrlog cluster where some configs are local for every PC, some are common for all PCs). X is replaced with log number.

Xcqrlog.cfg Holds all log based settings (all information set in preferences). Every log can have it's own settings. This file is visible only when log is open. When it is closed file is saved to database and deleted from folder. X is replaced with log number.

At start window "Open database" you can select a log, then press utils button and choose configuration/export and export preferences settings of that log (I.E contents of Xcqrlog.cfg).

At same window you can select a newly created log (that is not yet open) and do utils/configuration/import from previously saved settings file. That saves lot of typing as it sets the preferences from imported file.
Note: If NewQSO is open you can go to "open database window" from File/Open or create new log and do utils/configuration/export from file that is already opened but you can not do utils/configuration/import to log file that is already open. (you can, but results are unexpected. In very latest version (copield from source) this is prohibited).

--
Saku
OH1KH

KW2P
Ahh! Thank you for the

Ahh! Thank you for the detailed answer. I'm saving that in my documentation collection. And, that answers my question.

I'm glad I asked. That's not the architecture I was expecting. (That's not a criticism! ;-)

I'm using save local. It seemed the simple and obvious choice. I have no plans to ever network the CQR database.

Thank you again
Phil