chore(index): index dml (#10482)

What:
- DML - `autoincrement` property
- Index `type` option (GIN)
- Index module - DML
This commit is contained in:
Carlos R. L. Rodrigues
2024-12-10 07:55:12 -03:00
committed by GitHub
parent 096f1c2a9b
commit 69f4c4f4e0
17 changed files with 482 additions and 215 deletions

View File

@@ -12,6 +12,7 @@ import {
InjectTransactionManager,
isDefined,
MedusaContext,
toMikroORMEntity,
} from "@medusajs/framework/utils"
import { EntityManager, SqlEntityManager } from "@mikro-orm/postgresql"
import { IndexData, IndexRelation } from "@models"
@@ -338,8 +339,10 @@ export class PostgresProvider implements IndexTypes.StorageProvider {
const { transactionManager: em } = sharedContext as {
transactionManager: SqlEntityManager
}
const indexRepository = em.getRepository(IndexData)
const indexRelationRepository = em.getRepository(IndexRelation)
const indexRepository = em.getRepository(toMikroORMEntity(IndexData))
const indexRelationRepository = em.getRepository(
toMikroORMEntity(IndexRelation)
)
const {
data: data_,
@@ -432,7 +435,7 @@ export class PostgresProvider implements IndexTypes.StorageProvider {
const { transactionManager: em } = sharedContext as {
transactionManager: SqlEntityManager
}
const indexRepository = em.getRepository(IndexData)
const indexRepository = em.getRepository(toMikroORMEntity(IndexData))
const { data: data_, entityProperties } = PostgresProvider.parseData(
data,
@@ -479,8 +482,10 @@ export class PostgresProvider implements IndexTypes.StorageProvider {
const { transactionManager: em } = sharedContext as {
transactionManager: SqlEntityManager
}
const indexRepository = em.getRepository(IndexData)
const indexRelationRepository = em.getRepository(IndexRelation)
const indexRepository = em.getRepository(toMikroORMEntity(IndexData))
const indexRelationRepository = em.getRepository(
toMikroORMEntity(IndexRelation)
)
const { data: data_ } = PostgresProvider.parseData(
data,
@@ -533,8 +538,10 @@ export class PostgresProvider implements IndexTypes.StorageProvider {
const { transactionManager: em } = sharedContext as {
transactionManager: SqlEntityManager
}
const indexRepository = em.getRepository(IndexData)
const indexRelationRepository = em.getRepository(IndexRelation)
const indexRepository = em.getRepository(toMikroORMEntity(IndexData))
const indexRelationRepository = em.getRepository(
toMikroORMEntity(IndexRelation)
)
const { data: data_, entityProperties } = PostgresProvider.parseData(
data,
@@ -654,8 +661,10 @@ export class PostgresProvider implements IndexTypes.StorageProvider {
const { transactionManager: em } = sharedContext as {
transactionManager: SqlEntityManager
}
const indexRepository = em.getRepository(IndexData)
const indexRelationRepository = em.getRepository(IndexRelation)
const indexRepository = em.getRepository(toMikroORMEntity(IndexData))
const indexRelationRepository = em.getRepository(
toMikroORMEntity(IndexRelation)
)
const { data: data_ } = PostgresProvider.parseData(
data,