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

remult

Package Overview
Dependencies
Maintainers
0
Versions
623
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

remult - npm Package Versions

13
63

0.27.23-next.0

Diff

noamhonig
published 0.27.22 •

Changelog

Source

[0.27.22] 2024-11-08

  • Improved support for sveltekit ssr. To configure:

    • To enable remult across all sveltekit route

      // src/hooks.server.ts
      import { api } from './server/api'
      export const handle = api
      
    • To Use remult in ssr PageLoad - this will leverage the event's fetch to load data on the server without reloading it on the frontend, and abiding to all api rules even when it runs on the server

      // src/routes/+page.ts
      import { remult } from 'remult'
      import type { PageLoad } from './$types'
      
      export const load = (async (event) => {
        // Instruct remult to use the special svelte fetch to fetch data on server side page load
        remult.useFetch(event.fetch)
        return repo(Task).find()
      }) satisfies PageLoad
      
noamhonig
published 0.27.22-next.1 •

noamhonig
published 0.27.22-next.0 •

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 •

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