AndreasSko / go-jwlm

A command line tool to easily merge JW Library backups, written in Go.
MIT License
71 stars 3 forks source link

Importing TagMap: „Converting NULL to int is unsupported“ #115

Closed AndreasSko closed 2 years ago

AndreasSko commented 2 years ago

The following error was reported when importing a backup:

Error while scanning results from SQLite database: sql: Scan error on column index 4, name "Tagld": converting NULL to int is unsupported

This looks to be an issue when importing TagMaps.

AndreasSko commented 2 years ago

For some reason the db contains an entry with all NULL values, even though this is against the schema:

Bildschirmfoto 2021-12-10 um 09 03 46

Might be necessary to check the database for possible inconsistencies or handle those when scanning a row.

AndreasSko commented 2 years ago

Idea: In case rows.Scan returns an error, check if it's because of some type issues: get rows.ColumnTypes() and compare with actual row content. If there is a mismatch, we can ignore the error and continue.