-
Notifications
You must be signed in to change notification settings - Fork 387
Open
Labels
apiRelated to library's APIRelated to library's APIbreaking changeIncludes breaking changesIncludes breaking changesdeprecationSomething is/should be deprecatedSomething is/should be deprecatedinternalmigrationsRelated to migrationsRelated to migrations
Description
Hey 👋
In most cases, kysely.schema is only used in migrations. Migrations are development/CI-time, not runtime.
This is wasteful when looking at runtime bundle sizes. There's a lot of unused code not being shaken out it seems.
So probably:
SchemaModuleneeds to be exposed in its own path -kysely/schema' probably, and replaced insrc/index.ts` with a hint that tells you to import from the new location.
and either:
- make
Kyselyaccept an optionalSchemaModulein construction. - make
kysely.schemause the passedSchemaModuleor error telling you to pass it in order to use the getter. - make
Migratorreconstruct theKysely/transaction instance provided to it withSchemaModuleout the box so everyone's migration setups/files don't break.
or..
kysely.schemaneeds to be replaced with an error that tells you to either useSchemaModuledirectly, or provide ways to enable the legacy way.- A
useSchemaGetter(or another name) needs to be implemented to enable legacy way - injecting toKyselyprototype, perhaps module augmentation (tho I remember reading this is deprecated intsgo?!) - Make
MigratorrunuseSchemaGettereagerly so everyone's migration files don't break.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
apiRelated to library's APIRelated to library's APIbreaking changeIncludes breaking changesIncludes breaking changesdeprecationSomething is/should be deprecatedSomething is/should be deprecatedinternalmigrationsRelated to migrationsRelated to migrations