Check whether a table exists in the connected PostgreSQL database.
A configured Knex instance (or transaction).
The table name to check.
true when the table exists.
true
const exists = await tableExistsInDb(knex, 'users');if (!exists) await generateCreateTable(UserSchema)(knex); Copy
const exists = await tableExistsInDb(knex, 'users');if (!exists) await generateCreateTable(UserSchema)(knex);
Check whether a table exists in the connected PostgreSQL database.