Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

remult

Package Overview
Dependencies
Maintainers
0
Versions
631
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

remult - npm Package Versions

1
63

0.27.22-next.0

Diff

noamhonig
published 0.27.21 •

Changelog

Source

[0.27.21] 2024-10-28

  • Added upsert method:
    The upsert method allows inserting or updating an entity in a single operation. If an entity matching the where condition is found, it is updated; otherwise, a new entity is created. This can be used for a single entity or for batch operations with an array of options.

    Example:

    // Single entity upsert
    await taskRepo.upsert({
      where: { title: 'task a' },
      set: { completed: true },
    })
    
    // Batch upsert
    await taskRepo.upsert([
      { where: { title: 'task a' }, set: { completed: true } },
      { where: { title: 'task b' }, set: { completed: true } },
    ])
    
  • Now you can get data and aggregate info with a single request using the query method:

    const result = await repo
      .query({
        where: { completed: false },
        pageSize: 50,
        aggregates: {
          sum: ['salary'],
          average: ['age'],
        },
      })
      .paginator()
    // Accessing the items from the first page
    console.table(result.items)
    // Accessing the aggregation results
    console.log(result.aggregates.salary.sum) // Total salary sum
    
  • Added TestApiDataProvider to use in unit tests that test api rules. see tutorial

  • Fixed that values that are not included will not exist in the resulting object (previously they existed with value undefined)

  • Fixed that relations that were not included, will not be enumerable in the resulting object (previously they were only set to undefined)

  • Fixed serverExpression to run whenever we're not using a proxy data provider (for example RestDataProvider)

  • Fixed issue with updateMany where the set had ValueListType or relation.

  • Fixed issue when updating relation id and relation in the same update, the last one will win

  • Fixed makeTitle to handle all caps text

  • Added experimental api for sqlRelations & sqlRelationsFilter - see Sql Relations

noamhonig
published 0.27.21-next.18 •

noamhonig
published 0.27.21-next.17 •

noamhonig
published 0.27.21-next.16 •

noamhonig
published 0.27.21-next.15 •

noamhonig
published 0.27.21-next.14 •

noamhonig
published 0.27.21-next.13 •

noamhonig
published 0.27.21-next.12 •

noamhonig
published 0.27.21-next.11 •

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc