remult 0.27.2 → 0.27.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -41,6 +41,8 @@ Remult uses **TypeScript entities** as a single source of truth for: ✅ CRUD +
41
41
 
42
42
  **Remult is frontend and backend framework agnostic** and comes with adapters for Express, Fastify, Next.js, Nuxt, SvelteKit, SolidStart, Nest, Koa, Hapi and Hono.
43
43
 
44
+ > **Want to experience Remult firsthand? [Try our interactive online tutorial](https://learn.remult.dev/).**
45
+
44
46
  Remult promotes a **consistent query syntax for both frontend and Backend code**:
45
47
 
46
48
  ```ts
@@ -252,7 +252,7 @@ class KnexEntityDataProvider {
252
252
  }
253
253
  else {
254
254
  let result = await insert.returning(this.entity.idMetadata.field.key);
255
- newId = result[0].id;
255
+ newId = result[0][this.entity.idMetadata.field.key];
256
256
  }
257
257
  return this.find({
258
258
  where: new Filter((x) => x.isEqualTo(this.entity.idMetadata.field, newId)),
@@ -1,12 +1,14 @@
1
1
  export const flags = {
2
2
  error500RetryCount: 4,
3
3
  };
4
+ //y1 - Hacker News for the tutorial?
4
5
  /*y1 - https://github.com/remult/remult/discussions/438
5
6
  - https://github.com/remult/remult/blob/query-argumets/projects/tests/dbs/test-sql-database.spec.ts#L100-L128
6
7
  //p2 - allow preprocess to replace filter values - for example replace $contains on a specific field, with specific other sql - useful for full text search and other scenarios
7
8
  //y1 - consider sql expression gets a dbnames of it's own (that already has the "tableName" defined correctly) maybe also the filter translator
8
9
  //y2 - soft-delete-discussion https://discord.com/channels/975754286384418847/1230386433093533698/1230386433093533698
9
10
  */
11
+ //y1 - add parameter all to deleteMany, and updateMany
10
12
  //p1 - fix query docs to also explain how it can be used for infinite scroll and pagination.
11
13
  //y1 - 'test expression columns without aliases'
12
14
  //y1 - live query update waits for last
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "remult",
3
- "version": "0.27.2",
3
+ "version": "0.27.4",
4
4
  "description": "A CRUD framework for full-stack TypeScript",
5
5
  "homepage": "https://remult.dev",
6
6
  "repository": {
@@ -468,7 +468,7 @@ var KnexEntityDataProvider = /** @class */ (function () {
468
468
  case 12: return [4 /*yield*/, insert.returning(this.entity.idMetadata.field.key)];
469
469
  case 13:
470
470
  result = _d.sent();
471
- newId_1 = result[0].id;
471
+ newId_1 = result[0][this.entity.idMetadata.field.key];
472
472
  _d.label = 14;
473
473
  case 14: return [2 /*return*/, this.find({
474
474
  where: new filter_interfaces_js_1.Filter(function (x) {
@@ -838,7 +838,7 @@ export interface Paginator<entityType> {
838
838
  * @template matchIdEntity The type used for matching IDs in the relation.
839
839
  * @template optionsType The type of find options to apply to the relation (default is FindOptionsBase<toEntity>).
840
840
  */
841
- export type RelationOptions<fromEntity, toEntity, matchIdEntity, optionsType extends FindOptionsBase<toEntity> = FindOptionsBase<toEntity>> = {
841
+ export interface RelationOptions<fromEntity, toEntity, matchIdEntity, optionsType extends FindOptionsBase<toEntity> = FindOptionsBase<toEntity>> extends Pick<FieldOptions, 'caption'> {
842
842
  /**
843
843
  * An object specifying custom field names for the relation.
844
844
  * Each key represents a field in the related entity, and its value is the corresponding field in the source entity.
@@ -865,7 +865,7 @@ export type RelationOptions<fromEntity, toEntity, matchIdEntity, optionsType ext
865
865
  * If false or not specified, related entities will need to be explicitly included using the `include` option.
866
866
  */
867
867
  defaultIncluded?: boolean;
868
- } & Pick<FieldOptions, 'caption'>;
868
+ }
869
869
  export type ObjectMembersOnly<T> = MembersOnly<{
870
870
  [K in keyof Pick<T, {
871
871
  [K in keyof T]: T[K] extends object | undefined | null ? T[K] extends Date | undefined | null ? never : K : never;
@@ -4,12 +4,14 @@ exports.flags = void 0;
4
4
  exports.flags = {
5
5
  error500RetryCount: 4,
6
6
  };
7
+ //y1 - Hacker News for the tutorial?
7
8
  /*y1 - https://github.com/remult/remult/discussions/438
8
9
  - https://github.com/remult/remult/blob/query-argumets/projects/tests/dbs/test-sql-database.spec.ts#L100-L128
9
10
  //p2 - allow preprocess to replace filter values - for example replace $contains on a specific field, with specific other sql - useful for full text search and other scenarios
10
11
  //y1 - consider sql expression gets a dbnames of it's own (that already has the "tableName" defined correctly) maybe also the filter translator
11
12
  //y2 - soft-delete-discussion https://discord.com/channels/975754286384418847/1230386433093533698/1230386433093533698
12
13
  */
14
+ //y1 - add parameter all to deleteMany, and updateMany
13
15
  //p1 - fix query docs to also explain how it can be used for infinite scroll and pagination.
14
16
  //y1 - 'test expression columns without aliases'
15
17
  //y1 - live query update waits for last