Skip to content

Commit 6fea57b

Browse files
committed
chore: wip
chore: wip
1 parent b986541 commit 6fea57b

File tree

1 file changed

+34
-1
lines changed
  • storage/framework/core/orm/src/generated

1 file changed

+34
-1
lines changed

storage/framework/core/orm/src/generated/User.ts

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,14 @@ async function findByEmail(email: string) {
505505
.executeTakeFirst()
506506
}
507507

508+
async function findByName(name: string) {
509+
return await db
510+
.selectFrom('users')
511+
.where('name', '=', name)
512+
.selectAll()
513+
.executeTakeFirst()
514+
}
515+
508516
async function where(
509517
criteria: Partial<UserType>,
510518
options: QueryOptions = {},
@@ -547,6 +555,26 @@ async function where(
547555
return await query.selectAll().execute()
548556
}
549557

558+
async function whereEmail(email: string) {
559+
return db.selectFrom('users')
560+
.where('email', '=', email)
561+
.selectAll()
562+
.execute()
563+
564+
// .executeTakeFirst()
565+
566+
// if (!user) return null
567+
568+
// return new UserModel(user)
569+
}
570+
571+
async function whereName(name: string) {
572+
return db.selectFrom('users')
573+
.where('name', '=', name)
574+
.selectAll()
575+
.execute()
576+
}
577+
550578
async function whereIn(
551579
column: keyof UserType,
552580
values: any[],
@@ -598,6 +626,8 @@ async function recent(number: number, options: QueryOptions = {}) {
598626
return await query.execute()
599627
}
600628

629+
const model = Model
630+
601631
export const User = {
602632
find,
603633
findMany,
@@ -607,10 +637,13 @@ export const User = {
607637
update,
608638
remove,
609639
findByEmail,
610-
Model,
640+
findByName,
641+
model,
611642
first,
612643
last,
613644
where,
645+
whereEmail,
646+
whereName,
614647
whereIn,
615648
count,
616649
recent,

0 commit comments

Comments
 (0)