Feature hasn't been suggested before.
Describe the enhancement you want to request
It would be great to have an option to manage tables in the database at runtime, not just through migrations.
For example:
const tableFactory = (name: string) =>
sqliteTable(name, {
id: integer({ mode: "number" }).primaryKey({ autoIncrement: true }),
....other columns
});
await tableFactory("some_table").createIfNotExists()
Or at least an option to generate SQL from this:
const tableFactory = (name: string) =>
sqliteTable(name, {
id: integer({ mode: "number" }).primaryKey({ autoIncrement: true }),
....other columns
});
const sql = tableFactory("some_table").getSQL()
await db.$client.execute(sql);
Feature hasn't been suggested before.
Describe the enhancement you want to request
It would be great to have an option to manage tables in the database at runtime, not just through migrations.
For example:
Or at least an option to generate SQL from this: