View Single Post
Old 12-22-2021, 09:14 AM   #1592
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,476
Karma: 8025702
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by davidfor View Post
Though maybe the starting point is to add something to calibre for the plugin to call. Passing in suggested names and the data type would help to get them created properly.
db.new_api.backend.create_custom_column()

The method is in db.backend.py, line 998 in current source. Reading the code, it throws an SQL exception if the lookup key is not unique. It throws VALUE_ERROR for some error conditions such as an invalid type or key. It modifies the custom column description table so that the column will appear next time calibre restarts.
chaley is offline   Reply With Quote