Skip to content

Commit 6853c9f

Browse files
committed
fix(adapter): Add count method w/o implementation (for now)
1 parent 739927a commit 6853c9f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/adapter.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export function mikroOrmAdapter(orm: MikroORM) {
2525

2626
const adapter = (options: BetterAuthOptions = {}): Adapter => ({
2727
id: "mikro-orm",
28+
2829
async create({model, data, select}) {
2930
const metadata = getEntityMetadata(model)
3031
const input = normalizeInput(metadata, data)
@@ -42,6 +43,11 @@ export function mikroOrmAdapter(orm: MikroORM) {
4243

4344
return normalizeOutput(metadata, entity, select) as any
4445
},
46+
47+
async count(): Promise<number> {
48+
throw new Error("Not implemented yet, and not included in any release")
49+
},
50+
4551
async findOne({model, where, select}) {
4652
const metadata = getEntityMetadata(model)
4753

@@ -56,6 +62,7 @@ export function mikroOrmAdapter(orm: MikroORM) {
5662

5763
return normalizeOutput(metadata, entity, select) as any
5864
},
65+
5966
async findMany({model, where, limit, offset, sortBy}) {
6067
const metadata = getEntityMetadata(model)
6168

@@ -77,6 +84,7 @@ export function mikroOrmAdapter(orm: MikroORM) {
7784

7885
return rows.map(row => normalizeOutput(metadata, row)) as any
7986
},
87+
8088
async update({model, where, update}) {
8189
const metadata = getEntityMetadata(model)
8290

@@ -94,6 +102,7 @@ export function mikroOrmAdapter(orm: MikroORM) {
94102

95103
return normalizeOutput(metadata, entity) as any
96104
},
105+
97106
async updateMany({model, where, update}) {
98107
const metadata = getEntityMetadata(model)
99108

@@ -107,6 +116,7 @@ export function mikroOrmAdapter(orm: MikroORM) {
107116

108117
return affected
109118
},
119+
110120
async delete({model, where}) {
111121
const metadata = getEntityMetadata(model)
112122

@@ -119,6 +129,7 @@ export function mikroOrmAdapter(orm: MikroORM) {
119129
await orm.em.removeAndFlush(entity)
120130
}
121131
},
132+
122133
async deleteMany({model, where}) {
123134
const metadata = getEntityMetadata(model)
124135

0 commit comments

Comments
 (0)