Libraries
    Preparing search index...
    • Check whether a table exists in the connected PostgreSQL database.

      Parameters

      • knex: Knex

        A configured Knex instance (or transaction).

      • tableName: string

        The table name to check.

      Returns Promise<boolean>

      true when the table exists.

      const exists = await tableExistsInDb(knex, 'users');
      if (!exists) await generateCreateTable(UserSchema)(knex);