You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/** * Migrations are used to upgrade your database structure as you roll out new versions of code. These can be ran automatically, programatically. Torm currently only supports forward migrations. At the end of the day, this class essentially just wraps logic around version numbers and a function call with access to a database driver. * @example * ```ts * const migrations = new MigrationRegistry() * * @migrations.register() * class AddNewColumnMigration extends Migration { * version = '1.1.0' * * call() { * this.driver.exec(`ALTER TABLE book ADD COLUMN genre TEXT`) * } * } * * class BookORM extends Torm {} * * const db = new BookORM('books.db', {migrations}) * db.init({auto_migrate: false}) // this will prevent torm from automatically running migrations upon startup * // this is the general workflow for migrating manually: * const current_db_version = db.schemas.version() * if (db.migrations.is_database_outdated()) { * db.migrations.upgrade_database() * } * * ``` */
andykais
changed the title
@example seems to fail to parse whole snippet
@example seems to fail to parse whole snippet when using decorators
Feb 27, 2025
I have the following class docstring: https://jsr.io/@torm/sqlite/1.6.0/drivers/sqlite.ts#L158
but the generated example https://jsr.io/@torm/[email protected]/doc/~/Migration only shows the first line. If I had to guess, this probably has to do with the javascript decorator

@migrations
The text was updated successfully, but these errors were encountered: