Skip to content

0.26.2

Compare
Choose a tag to compare
@koskimas koskimas released this 25 Aug 18:08
· 196 commits to master since this release
  • Added support for select statements without a from clause. The function is called selectNoFrom. The function name was selected after a lot of discussion. The most natural name would just be select, but new users would find that in a list of autocompletions before selectFrom and naturally use it when trying to create a select from query. This would be especially true for people coming from knex where a select from query is started using a select call. #605
  • Add object variants of and and or functions. Allows easy where(eb => eb.and(object)) filters. #583
  • Add support for tuples. See some examples here. #611
  • Add addPrimaryKeyConstraint for AlterTableBuilder. #639 Thank you @n7olkachev ❤️
  • Add any function to function module. #612
  • Add between method to expression builder. #602
  • Add lit method to expression builder. #600
  • Add multi-column variant of orderBy. #423 Thank you @igalklebanov ❤️

An example of an object and call:

const persons = await db
  .selectFrom('person')
  .selectAll()
  .where((eb) => eb.and({
    first_name: 'Jennifer',
    last_name: eb.ref('first_name')
  }))
  .execute()
select * from "person"
where "first_name" = $1 and "last_name" = "first_name"