Skip to main content
Version: 6.3

MongoSchemaGenerator

Hierarchy

Index

Constructors

constructor

Methods

clearDatabase

  • Parameters

    Returns Promise<void>

createDatabase

  • createDatabase(name?: string): Promise<void>
  • creates new database and connects to it


    Parameters

    • optionalname: string

    Returns Promise<void>

createSchema

dropDatabase

  • dropDatabase(name?: string): Promise<void>
  • Parameters

    • optionalname: string

    Returns Promise<void>

dropIndexes

  • dropIndexes(options?: { collectionsWithFailedIndexes?: string[]; skipIndexes?: { collection: string; indexName: string }[] }): Promise<void>
  • Parameters

    • optionaloptions: { collectionsWithFailedIndexes?: string[]; skipIndexes?: { collection: string; indexName: string }[] }
      • optionalcollectionsWithFailedIndexes: string[]
      • optionalskipIndexes: { collection: string; indexName: string }[]

    Returns Promise<void>

dropSchema

  • dropSchema(options?: { dropMigrationsTable?: boolean }): Promise<void>
  • Parameters

    • options: { dropMigrationsTable?: boolean } = {}
      • optionaldropMigrationsTable: boolean

    Returns Promise<void>

ensureDatabase

  • ensureDatabase(): Promise<boolean>
  • Returns true if the database was created.


    Returns Promise<boolean>

ensureIndexes

  • Parameters

    Returns Promise<void>

execute

  • execute(query: string): Promise<void>
  • Parameters

    • query: string

    Returns Promise<void>

getCreateSchemaSQL

  • Parameters

    Returns Promise<string>

getDropSchemaSQL

  • Parameters

    Returns Promise<string>

getUpdateSchemaMigrationSQL

  • getUpdateSchemaMigrationSQL(options?: UpdateSchemaOptions<unknown>): Promise<{ down: string; up: string }>
  • Parameters

    Returns Promise<{ down: string; up: string }>

getUpdateSchemaSQL

  • Parameters

    Returns Promise<string>

refreshDatabase

updateSchema

staticregister