mysql-schema-ts
mysql-schema-ts copied to clipboard
[IDEA] Add schema type output
Besides generating T & TWithDefault, generate schema type/interface like this:
export type Schema = { // this name could contain database name mby?
user: { normal: User; withDefaults: UserWithDefaults }; // key being table name, value could be a tuple [T, TWithDefaults] - no preference
movie: { normal: Movie; withDefaults: MovieWithDefaults }
};
so its output can be easily consumed by some query builders that require database schema to work on (ex. kysely).
That's a pretty neat idea! I would be down to approve a PR :)
Any preference between object (or maybe other keys?) vs tuple approach?