@strapi/database 4.5.0 → 4.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -226,8 +226,7 @@ const cleanOrderColumns = async ({ id, attribute, db, inverseRelIds, transaction
226
226
  // https://github.com/knex/knex/issues/2504
227
227
  switch (strapi.db.dialect.client) {
228
228
  case 'mysql':
229
- await db
230
- .getConnection()
229
+ await db.connection
231
230
  .raw(
232
231
  `UPDATE
233
232
  ?? as a,
@@ -243,17 +242,16 @@ const cleanOrderColumns = async ({ id, attribute, db, inverseRelIds, transaction
243
242
  .transacting(trx);
244
243
  break;
245
244
  default:
246
- await db
247
- .getConnection()
245
+ await db.connection
248
246
  .raw(
249
247
  `UPDATE ?? as a
250
- SET ${update.join(', ')}
251
- FROM (
252
- SELECT ${select.join(', ')}
253
- FROM ??
254
- WHERE ${where.join(' OR ')}
255
- ) AS b
256
- WHERE b.id = a.id`,
248
+ SET ${update.join(', ')}
249
+ FROM (
250
+ SELECT ${select.join(', ')}
251
+ FROM ??
252
+ WHERE ${where.join(' OR ')}
253
+ ) AS b
254
+ WHERE b.id = a.id`,
257
255
  [joinTable.name, ...updateBinding, ...selectBinding, joinTable.name, ...whereBinding]
258
256
  )
259
257
  .transacting(trx);
package/lib/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { LifecycleProvider } from './lifecycles';
2
2
  import { MigrationProvider } from './migrations';
3
- import { SchemaProvideer } from './schema';
3
+ import { SchemaProvider } from './schema';
4
4
 
5
5
  type LogicalOperators<T> = {
6
6
  $and?: WhereParams<T>[];
@@ -154,7 +154,7 @@ interface DatabaseConfig {
154
154
  models: ModelConfig[];
155
155
  }
156
156
  export interface Database {
157
- schema: SchemaProvideer;
157
+ schema: SchemaProvider;
158
158
  lifecycles: LifecycleProvider;
159
159
  migrations: MigrationProvider;
160
160
  entityManager: EntityManager;
@@ -38,7 +38,7 @@ export interface Model {
38
38
  };
39
39
  }
40
40
 
41
- export interface SchemaProvideer {
41
+ export interface SchemaProvider {
42
42
  sync(): Promise<void>;
43
43
  syncSchema(): Promise<void>;
44
44
  reset(): Promise<void>;
@@ -46,4 +46,4 @@ export interface SchemaProvideer {
46
46
  drop(): Promise<void>;
47
47
  }
48
48
 
49
- export default function(db: Database): SchemaProvideer;
49
+ export default function(db: Database): SchemaProvider;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strapi/database",
3
- "version": "4.5.0",
3
+ "version": "4.5.1",
4
4
  "description": "Strapi's database layer",
5
5
  "homepage": "https://strapi.io",
6
6
  "bugs": {
@@ -42,5 +42,5 @@
42
42
  "node": ">=14.19.1 <=18.x.x",
43
43
  "npm": ">=6.0.0"
44
44
  },
45
- "gitHead": "33debd57010667a3fc5dfa343a673206cfb956e1"
45
+ "gitHead": "8c20ea2b5c5a115b78454086ea270dcd59b06004"
46
46
  }