import type { BetterAuthOptions } from 'better-auth'; import { type DBAdapterInstance } from 'better-auth/adapters'; import type { SqlfuConfig, SqlfuProjectConfig } from './types.js'; export interface SqlfuBetterAuthAdapterInput { sqlfu?: SqlfuConfig | SqlfuProjectConfig; adapter?: DBAdapterInstance; projectRoot?: string; configPath?: string; } /** * Wraps a Better Auth adapter so Better Auth's `auth generate` command updates * sqlfu's configured `definitions.sql` instead of asking Better Auth to own * migration files or database diffs. * * This adapter is currently intended and tested for schema generation. If you * call `sqlfuBetterAuthAdapter()` with no input, it resolves `sqlfu.config.*` * from the current working directory and installs schema-only runtime methods * that throw if used outside `auth generate`. If you pass `adapter`, runtime * create/read/update/delete methods are delegated to that adapter, but sqlfu * does not currently claim deeper runtime adapter coverage beyond that * delegation. After running `auth generate`, keep sqlfu as the migration owner * by running `sqlfu draft` and `sqlfu migrate`. * * The Better Auth schema SQL is generated by running Better Auth's Kysely * migration compiler against an empty in-memory SQLite database. That keeps * sqlfu aligned with Better Auth's own SQLite SQL output, but currently means * wrapped adapter naming options such as `usePlural` are not part of the tested * schema-generation contract. The generated Better Auth section is formatted * with sqlfu's formatter. On the first run for a nonempty definitions file, the * adapter appends the managed section when the combined desired schema applies * cleanly to a scratch SQLite database. */ export declare function sqlfuBetterAuthAdapter(input?: SqlfuBetterAuthAdapterInput): DBAdapterInstance;