{"id":37192654,"url":"https://github.com/clj/kom","last_synced_at":"2026-01-14T22:21:27.745Z","repository":{"id":159472652,"uuid":"634653496","full_name":"clj/kom","owner":"clj","description":"Interface KiCad database libraries with non-ODBC systems using the magic of SQLite3","archived":true,"fork":false,"pushed_at":"2023-09-09T20:06:27.000Z","size":36,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-06-21T17:06:12.371Z","etag":null,"topics":["kicad","odbc"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/clj.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-30T20:18:50.000Z","updated_at":"2023-09-09T20:06:35.000Z","dependencies_parsed_at":"2024-06-21T15:44:14.799Z","dependency_job_id":"0318a514-b795-4a9a-ae5c-9b95d7bbfaef","html_url":"https://github.com/clj/kom","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/clj/kom","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clj%2Fkom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clj%2Fkom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clj%2Fkom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clj%2Fkom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/clj","download_url":"https://codeload.github.com/clj/kom/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clj%2Fkom/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28436283,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T21:32:52.117Z","status":"ssl_error","status_checked_at":"2026-01-14T21:32:33.442Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["kicad","odbc"],"created_at":"2026-01-14T22:21:26.886Z","updated_at":"2026-01-14T22:21:27.720Z","avatar_url":"https://github.com/clj.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# KiCad ODBC Middleware\n\n\u003e **Warning**\n\u003e This repository is archived, please see:\n\u003e\n\u003e * https://github.com/clj/kom2 (also archived)\n\u003e\n\u003e For further development of this idea.\n\nAn SQLite3 Virtual Table that can interface KiCad's Database Libraries to component libraries that don't speak SQL.\n\n## Supported Backends\n\n* [Inventree](https://inventree.org)\n\n## Installing\n\n### macOS\n\nInstall [unixODBC](https://www.unixodbc.org), [SQLiteODBC](https://ch-werner.homepage.t-online.de/sqliteodbc/html/index.html) and [SQLite3](https://www.sqlite.org). This can be done using [homebrew](https://brew.sh):\n\n```shell\n$ brew install unixodbc sqliteodbc sqlite3\n```\n\nYou most likely have to install SQLite3 from homebew, even though macOS already comes with SQLite3. This is because the  version that comes as standard with the OS does not have the ability to load modules.\n\nThe homebrew SQLite3 command won't run by default. See `brew info sqlite3` for instructions on how to make it the default command, or use the full path, e.g.: `/usr/local/opt/sqlite/bin/sqlite3` when setting up the database below.\n\nDownload the latest kicad-odbc-middleware release from [Releases](https://github.com/clj/kom/releases):\n\n* For Intel based Macs:\n    * kicad-odbc-middleware-**macos**-**amd64**-VERSION.zip\n* For Apple Silicon (ARM) Macs:\n    * kicad-odbc-middleware-**macos**-**arm64**-VERSION.zip\n\ndecompress it and leave the kom.dylib file somewhere convenient.\n\n### Linux\n\nContributions welcome.\n\n### Windows\n\nContributions welcome.\n\n## Configuration\n\n### ODBC Configuration\n\nSet up a datasource, by adding the appropriate configuration to `~/.odbc.ini`:\n\n```ini\n[inventree]\nDriver=/usr/local/lib/libsqlite3odbc.dylib\nDescription=InvenTree Datasource\nDatabase=/Users/me/inventree/inventree.db\nLoadExt=/Users/me/inventree/kom\n```\n\nassuming that you have extracted the kicad-odbc-middleware to `/Users/me/inventree/` and that you will be creating a database `inventree.db` in the same location (see the next step.)\n\n### Middleware Configuration\n\nOpen the SQLite database which will hold the configuration:\n\n```shell\n$ sqlite3 /Users/me/inventree/inventree.db\n```\nCreate a settings table and add the required settings:\n\n```sql\n.load /Users/me/inventree/kom\nCREATE TABLE settings (key, value);\nINSERT INTO settings VALUES (\"server\", \"http://localhost:45454\");\nINSERT INTO settings VALUES (\"username\", \"user123\");\nINSERT INTO settings VALUES (\"password\", \"veryverysecret!\");\n```\n\nYou can update these values at any time, though you will have to restart KiCad to use any new settings.\n\nCreate one or more database libraries:\n\n```sql\nCREATE VIRTUAL TABLE Resistors USING\n    kom(plugin=\"inventree\", settings=\"settings\",\n        categories=\"Resistors\", default_symbol=\"Device:R\",\n        default_footprint=\"Resistor_SMD:R_0805_2012Metric\",\n        fields=\"Category:(int)category, Active:(int)active=(int)0, FullName:full_name, ClampingVoltage:parameters.Clamping Voltage\"));\n```\n\nAvailable options:\n\n* `plugin`:\n    * The name of the plugin to use\n    * Available plugins: inventree\n* `settings`:\n    * The name of the table that stores settings\n\nOptions specific to the **inventree** plugin:\n* `categories`:\n    * The category to return parts from\n* `default_symbol` (optional):\n    * The default symbol to return if no symbol is configured for a part\n* `default_footprint` (optional):\n    * The default footprint to return if no symbol is configured for a part\n* `fields` (optional):\n    * Define one or more additional fields to expose to KiCad, or redefine the default fields\n    * Default fields are: PK, IPN, Name, Keywords, Description, Symbols, Footprints\n    * Both PK and IPN can be used in the `key` setting in the kicad_dbl file (see below.). However when IPN is used, it is recommended that [\"Allow duplicate IPN\" setting](https://docs.inventree.org/en/latest/settings/global/#main-settings) in InvenTree is set to false.\n\nIf you need to reconfigure a table, simply `DROP TABLE ____` and recreate it with the desired options.\n\n#### Caveats\n\n* You have to configure a default_symbol to get any sensible behaviour at the moment\n* Despite the configuration option `categories` being plural, only one category can be specified at a time for a table currently\n\n\n#### Field Definitions\n\nFields are defined as a comma separated list of field definitions matching the following format:\n\n```\ndestination:(type)source=(default_type)default\n```\n\nWhere:\n\n* `destination` - field name exposed to KiCad\n* `source` - field name returned by the InvenTree API\n* `type` - SQL type (int, float, string) to convert the returned value to\n* `default` - default value to return if the field is not present in InvenTree response\n* `default_type` - the type of the default value if it should not be a string\n\nThe `source` field can access nested structures (mappings only) can be accessed using dot notation, e.g.: `metadata.kicad.footprints`. Use one of the following key prefixes to access other information:\n\n* `metadata.` - access data from the metadata table.\n* `parameters.` - access part parameters.\n\nWhen none of these prefixes are used, keys are looked up in the data returned by the Parts API. Metadata and parameters are only fetched when KiCad requests data for a specific part (by using a primary key constraint).\n\n### KiCad Configuration\n\nCreate a `inventree.kicad_dbl` file with a valid configuration (see the [KiCad documentation on Database Libraries](https://docs.kicad.org/master/en/eeschema/eeschema.html#database-libraries)), e.g.:\n\n```json\n{\n    \"meta\": {\n        \"version\": 0\n    },\n    \"name\": \"Inventree Library\",\n    \"description\": \"Components pulled from Inventree\",\n    \"source\": {\n        \"type\": \"odbc\",\n        \"dsn\": \"inventree\",\n        \"timeout_seconds\": 2\n    },\n    \"libraries\": [\n        {\n            \"name\": \"Resistors\",\n            \"table\": \"Resistors\",\n            \"key\": \"IPN\",\n            \"symbols\": \"Symbols\",\n            \"footprints\": \"Footprints\",\n            \"fields\": [\n                {\n                    \"column\": \"IPN\",\n                    \"name\": \"IPN\",\n                    \"visible_on_add\": false,\n                    \"visible_in_chooser\": true,\n                    \"show_name\": true,\n                    \"inherit_properties\": true\n                },\n                {\n                    \"column\": \"Value\",\n                    \"name\": \"Value\",\n                    \"visible_on_add\": true,\n                    \"visible_in_chooser\": true,\n                    \"show_name\": false\n                }\n            ],\n            \"properties\": {\n                \"description\": \"Description\",\n                \"keywords\": \"Keywords\"\n            }\n        }\n    ]\n}\n```\n\nThe above configuration would work well with a table that has been created with the following parameters:\n\n```sql\nCREATE VIRTUAL TABLE Resistors USING\n    kom(plugin=inventree, settings=settings,\n    categories=\"Resistors\", default_symbol=\"Device:R\",\n    fields=\"Value:parameters.Value\")\n```\n\nAdd the library to KiCad:\n\n* *Preferences* -\u003e *Manage Symbol Libraries...*\n* Switch to the:\n    * *Global Libraries*; or\n    * *Project Specific Libraries*\n* Add a new library\n* Give it an appropriate *Nickname*\n* Set the *Library Path* to point to the `inventree.kicad_dbl` that you created earlier\n* Set the *Library Format* to *Database*\n\nYou can now open the Schematic Editor and add a new component. The configured library should now be available.\n\n## License\n\nMIT License Copyright (c) 2023 Christian Lyder Jacobsen\n\nRefer to [LICENSE](./LICENSE) for full text.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclj%2Fkom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclj%2Fkom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclj%2Fkom/lists"}