Questions about database libraries

Playing with the database library functions, trying to understand how it all works before I migrate my existing workflow over to it. (KiCAD 7.0 release build)

I have a sqlite database named “2_passives.sqlite” and an accompanying JSON file named 2_passives.kicad_dbl. I am only messing with the capacitor data at this point, its “fields” section in the JSON file reads:

{
“column”: “PN”,
“name”: “PN”,
“visible_on_add”: false,
“visible_in_chooser”: true
},
{
“column”: “Manufacturer”,
“name”: “Manufacturer”,
“visible_on_add”: false,
“visible_in_chooser”: false
},
{
“column”: “MPN”,
“name”: “MPN”,
“visible_on_add”: false,
“visible_in_chooser”: true
},
{
“column”: “Capacitance”,
“name”: “Value”,
“visible_on_add”: true,
“visible_in_chooser”: true
},
{
“column”: “Dielectric Type”,
“name”: “Dielectric”,
“visible_on_add”: true,
“visible_in_chooser”: false
},
{
“column”: “Voltage Rating”,
“name”: “Voltage Rating”,
“visible_on_add”: true,
“visible_in_chooser”: true
},
{
“column”: “Datasheet”,
“name”: “Datasheet”,
“visible_on_add”: false,
“visible_in_chooser”: true
}

The visible_on field setting works as advertised, the visible_in_chooser perhaps not - I might just not understand it. This is a screen capture of the chooser at some point:

My main issue is that though the JSON field settings include e.g. Voltage Rating / visible_in_chooser == true, it does not show in the columns of the list (No additional columns here). Also the two columns that do show are not sortable (by click on column header). What mistake am I making?

Lesser important (to me) is the repetition of the pre/post fix “cap”, this is just annoying there is no need to show this everywhere. If the database is called “2_passives” and the table inside it is “cap”, showing this as “2_passives - cap” makes sense, then cap/CAP-001 can just be listed as “CAP-001”, no? Sorry for being anal.

The bottom info section is great but there is no control over what shows and in which order, is there? I thought this would also be controlled by the JSON file.

Did you change this setting in the JSON file after the first time you added the library? If so, this is expected. The visible_in_chooser setting just controls whether or not a column will be added for you when you first add the library to your library table. After that, the visible columns are saved in user preferences, so you can add/hide them and they persist the next time you launch the chooser.

Column sorting is not yet supported here.

The fact that you call your database 2_passives makes me wonder if you realize that a single database library can contain multiple different “virtual libraries” that can each be collapsed in the symbol chooser. The “cap” part is so that there is a way to tell apart the different virtual libraries within one database library file. If you don’t want to make use of this feature, set the name field in the table config to an empty string instead of "cap".

No, there is no control over this section at the moment.

The visibility selection was made prior to adding the library. But just for good measure, I removed the library and re-added it - same result. Also, in preferences I do not see any of these fields in Schematic Editor/Field Name Templates. Am I in the right preference section?

I should note too that the “description” column was not at all visible at first as it was scooted way over to the right and I had to bring that in.

I would prefer to create a single database with tables for passives, semi etc. In fact, I like to recreate the layout I have at the moment:


But if I put everything in one database, every time I use the chooser, the top level is just one item (the db) that I must click on - too cumbersome all them clicks.

So I figured I make databases for the big sections (semi, passives, electromechanical etc) and tables inside each of these (for example, discrete, embedded etc in semi). As you can see I have 2.passive (my old flow) and 2.passives - cap and 2.passives - res (the new workflow). So if virtual libs add more clicks, I probably stay away from those.

And yes, I do not use any of the KiCAD libraries nor taxonomy. The taxonomy I use here largely follows DigiKey’s, not that it is the best, simply that it is a fairly easy to understand one.

OK, bummer, hope some control over this comes in 8. Visible/hidden would be great to have at first so I can optimize the dialog’s size.

You probably would have to delete your preferences as well.

These are not field name templates, so they don’t show up there.

VIrtual libs do not add more clicks, you can still only have one level of hierarchy. So for your use case where you want multiple levels of hierarchy you must create multiple database library config files.

If you want this, or anything else, open a feature request on GitLab or it has no chance of happening

Can you explain what behavior you are looking for / what you are trying to accomplish?

The use case for visible_in_chooser is to help get someone set up with good defaults the first time they add a library. After they have added the library (even if they delete and re-add it) the user’s preferences are kept, and the way that is currently implemented, this means that you can’t make fields appear by editing the JSON field after the fact.

If you created a brand-new file from scratch and the fields aren’t showing up, please report a bug with the kicad_dbl file attached.

I don’t really understand what you are trying to do – why are you looking for a spot they show up? Fields in the kicad_dbl are added to symbols that you place on the schematic. They show up on those symbols placed on the database, and nowhere else.

Different person but similar question. I’m trying to understand how to change the “visible_on_add” selection on an existing db table. I accidentally set it to ‘true’ on a table in my db and now everytime I place a capacitor I get “Device:C_US_Small” on my schematic. I’ve tried updating my JSON, deleting and re-adding my dbl and so on but that setting appears to stick. Is it also stored in some other config file? If so would you be able to point me at it?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.