@cbrake has demonstrated a working database for KiCad library parts using sqlite (see GitHub - git-plm/parts: parts database and KiCad Libraries). It would behoove us regarding the implementation of any database to try to come up with a standard set of field names for the parameters of various component types. Every library component has 4 reserved field names: “Reference”, “Value”, “Footprint”, “Datasheet”. While 3 of these are obvious it’s not clear what is the best way to use the ‘Value’ field. It seems that for all of the KiCad designs I’ve encountered the Value field is usually the same as the symbol name. The symbol name in the ascii format libraries is in effect the database key for these libraries but this is unsuited to an SQL database which requires a unique key for each entry. The Value field has been used for parameters of resistors and capacitors and other components. It seems the Value field is a good candidate for the SQL database key since that field is required and will always be present on every symbol. The symbol name only needs to be unique in its particular library. Two different resistor libraries could exist for example, each could have identical part names, but each part still must have a unique SQL database key.
Additional fields may be assigned to symbols as required. When selecting parts from multiple libraries, if field names are not broadly standardized across all of the various component libraries this can create a massively confusing bill of materials since a column in the BOM will be added for each unique field name encountered in a schematic or board file. Creating new symbols is tricky since KiCad does not have a “template” feature for each type of part being entered into a design. Most of the time a new part is entered simply by copying an existing part with all the fields already defined then simply modifying and saving the copy. I have to keep a “cheat sheet” handy listing all of my field names in use for each part type to prevent polluting my BOM’s. Achieving field naming uniformity is particularly important for designs that are collaborations. Everyone needs to be on the same page as there is no enforcement mechanism for field naming conventions when creating new parts.
Field names that I have been using recently are:
‘Part Number’ - customer’s or our internal source control documentation part number
‘Desc’ - This is a short version of the part description.
‘Description’ - This is the full part description. Both of these are available when browsing DigiKey parts.
‘Height’ - in mm, useful for PCB placement area rules that have height restrictions
‘Part Name’ - This is the name of the symbol in the ascii database. Provided here so that it can be placed in the BOM if necessary since the part name is not otherwise accessible if you wish to find the part to make a change, for example.
‘Val’ - used for resistance, capacitance, inductance
‘TOL’ - tolerance
‘Volt’ - voltage
Because customers always want multiple sources for each component I have definitions for 3 manufacturers, each manufacturer can have 3 alternative part numbers:
‘Mfr A’
‘Mfr A P/N 1’
‘Mfr A P/N 2’
‘Mfr A P/N 3’
‘Mfr B’
‘Mfr B P/N 1’ etc, etc.
Yes, field names can have spaces and special characters, but be careful this doesn’t jack up exporting a BOM to whatever format you wish to use. CSV file with quoted fields is the safest.