cded16d7f50b655f71c0c2ac43e78e326c8a2150
The sequence counter (sequences_by_name table) can get out of sync with the items table if items were seeded/imported directly or if a previous create failed after incrementing the sequence but before the insert committed. This causes Generate() to return a part number that already exists, hitting the unique constraint on items.part_number. Add a retry loop (up to 5 attempts) in HandleCreateItem that detects PostgreSQL unique violation errors (SQLSTATE 23505) via pgconn.PgError and retries with the next sequence value. Non-duplicate errors still fail immediately. If all retries are exhausted, returns 409 Conflict instead of 500.
Kindred Silo
Item database and part management system for Kindred Create.
Overview
Kindred Silo is an R&D-oriented item database with:
- Configurable part number generation via YAML schemas
- FreeCAD integration with git-like commands (checkout, commit, status)
- Revision tracking with append-only history
- BOM management with reference designators and alternates
- Physical inventory tracking with hierarchical locations
Components
silo/
├── cmd/
│ ├── silo/ # CLI tool
│ └── silod/ # API server
├── internal/
│ ├── api/ # HTTP handlers, routes, and templates
│ ├── config/ # Configuration loading
│ ├── db/ # PostgreSQL access
│ ├── migration/ # Property migration utilities
│ ├── partnum/ # Part number generation
│ ├── schema/ # YAML schema parsing
│ └── storage/ # MinIO file storage
├── pkg/
│ └── freecad/ # FreeCAD workbench (Python)
├── migrations/ # Database migration SQL scripts
├── schemas/ # Part numbering schema definitions (YAML)
├── deployments/ # Docker Compose and systemd configs
├── scripts/ # Deployment and setup scripts
└── docs/ # Documentation
Quick Start
# Database setup
psql -h psql.kindred.internal -U silo -d silo -f migrations/001_initial.sql
# Configure
cp config.example.yaml config.yaml
# Edit config.yaml with your settings
# Run server
go run ./cmd/silod
# CLI usage
go run ./cmd/silo register --schema kindred-rd --category F01
Configuration
See config.example.yaml for all options.
Kindred Create Integration
Install the workbench:
ln -s $(pwd)/pkg/freecad ~/.local/share/FreeCAD/Mod/KindredSilo
Then in Kindred Create, use the Silo workbench toolbar commands:
- Pull - Download an item by part number
- Commit - Save current state as a new revision with comment
- Push - Batch upload modified files
- Info - View revision history
License
MIT License - Copyright (c) 2026 Kindred Systems LLC
See LICENSE for details.
Languages
Go
68.5%
TypeScript
25.5%
Shell
2.7%
PLpgSQL
2.4%
Makefile
0.5%
Other
0.3%