Thank you for building and maintaining unadapter! It's an amazing tool that really simplifies managing dynamic database adapters.
Old request
Feature Request
I would like to request a schema generation feature for unadapter.
While unadapter currently provides an adapter-agnostic way to handle live database migrations via getMigrations(), it lacks a standalone code/schema generation mechanism. In comparison, better-auth (which unadapter's architecture is based on) provides a built-in CLI that allows users to generate the required database schemas or migration files based on configured tables and plugins:
I'm a Library author building on top of unadapter and and try to expose package's own CLI. A very common command is a generate step that writes out a schema file:
This kind of command needs to produce schema output from the schema definition. At this point, there is no database to connect to
Summary
unadapter can run and compile migrations through getMigrations(), but every path through it requires a live database connection. There is currently no public API to turn a TablesSchema into a schema string (SQL DDL, and Prisma/Drizzle) offline, without connecting to a database.
Thank you for building and maintaining unadapter! It's an amazing tool that really simplifies managing dynamic database adapters.
Old request
Feature Request
I would like to request a schema generation feature for unadapter.
While unadapter currently provides an adapter-agnostic way to handle live database migrations via getMigrations(), it lacks a standalone code/schema generation mechanism. In comparison, better-auth (which unadapter's architecture is based on) provides a built-in CLI that allows users to generate the required database schemas or migration files based on configured tables and plugins:
I'm a Library author building on top of unadapter and and try to expose package's own CLI. A very common command is a
generatestep that writes out a schema file:This kind of command needs to produce schema output from the schema definition. At this point, there is no database to connect to
Summary
unadapter can run and compile migrations through
getMigrations(), but every path through it requires a live database connection. There is currently no public API to turn aTablesSchemainto a schema string (SQL DDL, and Prisma/Drizzle) offline, without connecting to a database.