Releases: fisayoafolayan/kiln
Release list
v0.1.12
v0.1.11
update releaser flow
v0.1.10 - update releaser flow
v0.1.9
Fix optional fields with database defaults.
Fix optional fields with database defaults.
Fix M2M queries and enum validation
v0.1.7
Bug Fixes
- Fix M2M link/unlink/list queries on Postgres. to match Bob's
RawQuery. - Fix validation on optional enum fields.** Columns with both a
CHECKconstraint and aDEFAULTvalue (e.g.status TEXT DEFAULT 'draft' CHECK (status IN ('draft', 'published'))) generated aoneof=validation
tag withoutomitempty.
Internal
- Remove gin framework scaffolding from router and config.
- Simplify config internals. Replace cached map lookups with direct slice scans.
- Remove unused
ForeignKey.OnDeleteandForeignKey.OnUpdatefields. - Add router generator tests (11 tests covering CRUD, FK nested routes, M2M routes, operation disabling, endpoint overrides).
- Add IR tests for
IsReadOnly,ValidationTag,UpdateValidationTag,IsFilterable, andSupportsRangeOps.
bugfix: make m2m methods use bob's default query bilder
v0.1.6 fix M2M methods to use bob's default query builder
release v0.1.5
v0.1.4
What's New
Many-to-Many Relationships
Junction tables are now detected automatically and generate link/unlink endpoints on both sides of the relationship.
Given a schema:
CREATE TABLE post_tags (
post_id UUID NOT NULL REFERENCES posts(id) ON DELETE CASCADE,
tag_id UUID NOT NULL REFERENCES tags(id) ON DELETE CASCADE,
PRIMARY KEY (post_id, tag_id)
);kiln generates:
POST /api/v1/posts/{id}/tags link a tag to a post
DELETE /api/v1/posts/{id}/tags/{tagId} unlink a tag from a post
GET /api/v1/posts/{id}/tags list tags linked to a post
And the reverse on tags. Link operations are idempotent (ON CONFLICT DO NOTHING). Junction tables with extra columns (e.g. created_at) are detected and stored for future use.
Disable per table with disable: [link, unlink] in overrides.
Filter and Sort Validation
Invalid filter values now return 400 errors instead of being silently ignored:
GET /api/v1/users?created_at=garbage
→ 400 {"error": "invalid value for created_at: expected RFC3339 format"}
GET /api/v1/users?sort=nonexistent
→ 400 {"error": "invalid sort field: nonexistent"}
kiln doctor Command
New diagnostic command that checks project health without modifying files:
kiln doctor
Config
✓ kiln.yaml loaded
✓ driver: postgres
✓ output: ./generated
Schema
✓ 4 tables found (users, posts, comments, tags)
✓ junction: post_tags (posts ↔ tags)
Generated Files
✓ generated/models/users.go
⚠ generated/store/users.go (user-modified)
✗ generated/models/old_table.go (stale - table not in schema)
Overrides
✓ users: endpoint=members, hidden_fields=[password_hash]
Project
✓ go.mod found
No issues found
Store Accepts bob.Executor
Store constructors now accept bob.Executor instead of bob.DB. Both bob.DB and bob.Tx satisfy this interface, so you can wrap store calls in transactions without modifying generated code:
tx, _ := sqlDB.BeginTx(ctx, nil)
bobTx := bob.NewTx(tx)
userStore := store.NewUserStore(bobTx)
postStore := store.NewPostStore(bobTx)
user, _ := userStore.Create(ctx, userReq)
postReq.UserID = user.ID
postStore.Create(ctx, postReq)
tx.Commit()Pagination Fix
Count query now runs before the data fetch in all list methods (List, ListByParent, ListLinked). This ensures total is always >= the number of returned rows, which is the safe direction for pagination UIs.
Bob Plugin Documentation
Full guide for using kiln as a bob plugin: README section, dedicated docs page at docs/guides/bob-plugin.md, and a working example at examples/bob-plugin/ with gen/main.go.
Breaking Changes
IsReadOnly for Primary Key Columns
Primary key columns are now only auto-readonly if they have a database default (e.g. gen_random_uuid()). PK columns without defaults are writable. This affects composite PK tables if you add support for them in the future, but has no effect on single-PK tables with auto-generated IDs (the common case).
Store Constructor Signature
Generated store constructors changed from NewUserStore(db bob.DB) to NewUserStore(db bob.Executor). Existing code compiles without changes since bob.DB satisfies bob.Executor.
Internal Changes
- IR refactored from
PrimaryKey *ColumntoPrimaryKeys []*Column - Junction table detection moved from adapter to a classification pass after FK wiring
- Removed dead code:
plugin/adapter.go,TestsConfig, unused IR methods - Adapter test for composite PK tables updated (now included in schema, not skipped)
New Documentation
- Many-to-Many - junction table detection and M2M endpoints
- API Evolution - versioning, deprecation, breaking changes
- Escape Hatches - transactions, custom handlers, mixing generated and hand-written code
- Bob Plugin Mode - using kiln as a bob plugin
Fix unused import bug in handler
Fix unused import bug in handler