@@ -119,7 +119,11 @@ import {
119119
120120// Create a scheduling adapter
121121const scheduler = createHomegrownAdapter ({
122- db: drizzleInstance ,
122+ withDb : async (fn ) => fn (drizzleInstance ),
123+ schemas: {
124+ content: contentSchema ,
125+ booking: bookingSchema ,
126+ },
123127 timezone: ' America/New_York' ,
124128});
125129
@@ -170,17 +174,33 @@ Direct PostgreSQL adapter using Drizzle ORM. Replaces third-party scheduling
170174APIs entirely.
171175
172176``` typescript
173- import { createHomegrownAdapter } from ' @tummycrypt/scheduling-kit/adapters' ;
177+ import {
178+ createHomegrownAdapter ,
179+ type HomegrownAdapterSchemas ,
180+ } from ' @tummycrypt/scheduling-kit/adapters' ;
181+ import * as contentSchema from ' @tummycrypt/tinyland-business-pg/content-schema' ;
182+ import * as bookingSchema from ' @tummycrypt/tinyland-business-pg/booking-schema' ;
183+
184+ const schemas: HomegrownAdapterSchemas = {
185+ content: contentSchema ,
186+ booking: bookingSchema ,
187+ };
174188
175189const adapter = createHomegrownAdapter ({
176- db: drizzleInstance ,
190+ withDb : async (fn ) => fn (drizzleInstance ),
191+ schemas ,
177192 timezone: ' America/New_York' ,
178193});
179194
180195// 16 methods: getServices, getAvailability, getSlots, book, cancel,
181196// reschedule, ...
182197```
183198
199+ ` schemas ` is the preferred boundary for reusable adopters. It lets the
200+ homegrown backend use whichever Drizzle schema package owns business and
201+ booking tables. Existing adopters may still omit it if they intentionally use
202+ the legacy optional ` @tummycrypt/tinyland-auth-pg ` schema exports.
203+
184204### AcuityAdapter
185205
186206API-based adapter for Acuity Scheduling (requires Powerhouse plan).
0 commit comments