-
-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: creating dedicated query builders for all relationships
- Loading branch information
1 parent
2f5f588
commit 156073a
Showing
25 changed files
with
1,142 additions
and
190 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
// import { BaseModel } from '@ioc:Adonis/Lucid/Orm' | ||
// import Database from '@ioc:Adonis/Lucid/Database' | ||
import { BaseModel } from '@ioc:Adonis/Lucid/Orm' | ||
|
||
// class Profile extends BaseModel { | ||
// } | ||
class Profile extends BaseModel { | ||
} | ||
|
||
// class User extends BaseModel { | ||
// public username: string | ||
// public profile: Profile[] | ||
// } | ||
class User extends BaseModel { | ||
public username: string | ||
|
||
// user.saveRelated('profile', new Profile()) | ||
// const profile = user.$getRelated('profile') | ||
// console.log(profile) | ||
public profile: Profile | ||
} | ||
|
||
const user = new User() | ||
user.related('profile').where('username', 'virk').exec() |
Oops, something went wrong.