Skip to content
/ lucid Public

AdonisJS SQL ORM. Supports PostgreSQL, MySQL, MSSQL, Redshift, SQLite and many more

License

Notifications You must be signed in to change notification settings

adonisjs/lucid

Repository files navigation

Query Builder Features

  • Paginate method
  • forPage method
  • chunk ( removed )
  • pluckAll ( removed )
  • withPrefix
  • transactions
  • global transactions

Model

  • hooks
  • getters
  • setters
  • helper static methods
  • boot method ( ability to extend via BaseModel )
  • refresh model
  • fill model with json data
  • use traits
  • computed properties
  • visible/hidden attributes
  • timestamps

Eager Loading

User
  .query()
  .with('posts.comments')

// when constraints
User
  .query()
  .with('posts', (builder) => {
    builder.with('comments', () => {
    })
  })