lib_dblib_info
Inspect an Altium .DbLib file to identify its database provider, connection settings, tables, key fields, symbol and footprint columns; optionally list table columns by opening the database read-only.
Instructions
What a database library (.DbLib) declares, and how it connects.
A DbLib holds no symbols. It names a database (Access, Excel, SQL
Server, any ODBC or OLE DB source) and lists the tables whose rows
are the components; each row names a symbol in a .SchLib and
footprints in .PcbLibs. This reads the .DbLib file itself, inside
Altium, and with with_fields opens the database read-only to
list each table's columns. Call it first on an unfamiliar DbLib:
it says which column is each table's key, which carries the
symbol and which the footprints, which is what
lib_dblib_get_record and sch_place_dblib_component take.
THE PASSWORD IS NEVER RETURNED. connection.redacted is the
connection string with every Password / Pwd value replaced by
***, and has_password says whether there was one.
HOW EACH COLUMN WAS FOUND IS STATED. key_field_source is
key_setting or where_clause when the DbLib names it,
part_number_column when a column is called Part Number
(Altium's default), or first_column as a last resort; treat
the last as a guess. settings is the table's section of the
file as written, for anything the parsed fields do not cover.
Args: library_path: Full path of the .DbLib (or .SVNDbLib) file. lib_get_installed_libraries lists installed ones with library_type "database". with_fields: True (default) connects to the database to list every table's columns. False reads the file only and opens no connection: use it when the database is slow or unreachable, or to read the connection settings alone.
Returns: {"library_path", "connection": {"provider", "kind" (access / excel / sql_server / odbc / oracle / other), "data_source", "has_password", "redacted", "read_only"}, "left_quote", "right_quote", "search_path", "table_count", "tables": [{"name", "enabled", "schema", "key_field", "key_field_source", "key_field_found", "symbol_ref_field", "symbol_library_field", "description_field", "footprint_fields": [{"ref_field", "library_field"}], "fields" (null when not read), "field_count", "error", "settings"}], "sections", "fields_included", "connected" (null when no connection was attempted)}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| with_fields | No | ||
| library_path | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||