@@ -25,6 +25,7 @@ export function mikroOrmAdapter(orm: MikroORM) {
25
25
26
26
const adapter = ( options : BetterAuthOptions = { } ) : Adapter => ( {
27
27
id : "mikro-orm" ,
28
+
28
29
async create ( { model, data, select} ) {
29
30
const metadata = getEntityMetadata ( model )
30
31
const input = normalizeInput ( metadata , data )
@@ -42,6 +43,11 @@ export function mikroOrmAdapter(orm: MikroORM) {
42
43
43
44
return normalizeOutput ( metadata , entity , select ) as any
44
45
} ,
46
+
47
+ async count ( ) : Promise < number > {
48
+ throw new Error ( "Not implemented yet, and not included in any release" )
49
+ } ,
50
+
45
51
async findOne ( { model, where, select} ) {
46
52
const metadata = getEntityMetadata ( model )
47
53
@@ -56,6 +62,7 @@ export function mikroOrmAdapter(orm: MikroORM) {
56
62
57
63
return normalizeOutput ( metadata , entity , select ) as any
58
64
} ,
65
+
59
66
async findMany ( { model, where, limit, offset, sortBy} ) {
60
67
const metadata = getEntityMetadata ( model )
61
68
@@ -77,6 +84,7 @@ export function mikroOrmAdapter(orm: MikroORM) {
77
84
78
85
return rows . map ( row => normalizeOutput ( metadata , row ) ) as any
79
86
} ,
87
+
80
88
async update ( { model, where, update} ) {
81
89
const metadata = getEntityMetadata ( model )
82
90
@@ -94,6 +102,7 @@ export function mikroOrmAdapter(orm: MikroORM) {
94
102
95
103
return normalizeOutput ( metadata , entity ) as any
96
104
} ,
105
+
97
106
async updateMany ( { model, where, update} ) {
98
107
const metadata = getEntityMetadata ( model )
99
108
@@ -107,6 +116,7 @@ export function mikroOrmAdapter(orm: MikroORM) {
107
116
108
117
return affected
109
118
} ,
119
+
110
120
async delete ( { model, where} ) {
111
121
const metadata = getEntityMetadata ( model )
112
122
@@ -119,6 +129,7 @@ export function mikroOrmAdapter(orm: MikroORM) {
119
129
await orm . em . removeAndFlush ( entity )
120
130
}
121
131
} ,
132
+
122
133
async deleteMany ( { model, where} ) {
123
134
const metadata = getEntityMetadata ( model )
124
135
0 commit comments