How to use the knex function from knex

Find comprehensive JavaScript knex.knex code examples handpicked from public code repositorys.

30
31
32
33
34
35
36
37
38
39
  connection || process.env.CONNECT_TO || process.env.DATABASE_URL || process.env.KNEX_URI;

if (!knexConnection) {
  throw new Error(`No Knex connection URI specified.`);
}
this.knex = knex({
  client: this.client,
  connection: knexConnection,
  ...knexOptions,
});
fork icon31
star icon62
watch icon17

+ 5 other calls in file

156
157
158
159
160
161
162
163
164
165
}
this._config = incoreConfig;
if (!((_a = this.config) === null || _a === void 0 ? void 0 : _a.knex)) {
    throw new Error('knex must be set in incore.json');
}
this._knex = knex.knex(this.config.knex);
objection_1.Model.knex(this._knex);
this.createKnexFile();
const recreateTables = ((_b = this.config) === null || _b === void 0 ? void 0 : _b.incoreState) === undefined ||
    ((_c = this.config) === null || _c === void 0 ? void 0 : _c.incoreState) === 0;
fork icon0
star icon0
watch icon0

-2
fork icon0
star icon0
watch icon1

+ 3 other calls in file