jack
jack

Reputation: 81

MYSQL database create using knex

How to create database using knex npm?

Here it is MYSQL query

create database 'test'

I want to convert this query using knex.

Upvotes: 2

Views: 1259

Answers (1)

Mikael Lepistö
Mikael Lepistö

Reputation: 19718

There is no special API for creating DB in knex, probably because knex usually connects to already created DB and to be honest database creation is pretty rare operation.

Npm package knex-db-manager (https://vincit.github.io/knex-db-manager/) can do also database maintenance tasks and has separate superuser and normal user connection.

Upvotes: 2

Related Questions