bun-query-builder 0.2.40 → 0.2.41

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/dist/bin/cli.js CHANGED
@@ -32354,7 +32354,7 @@ function getPrefix() {
32354
32354
  }
32355
32355
  var prefix = getPrefix();
32356
32356
  // package.json
32357
- var version2 = "0.2.40";
32357
+ var version2 = "0.2.41";
32358
32358
 
32359
32359
  // bin/cli.ts
32360
32360
  init_actions();
package/dist/orm.d.ts CHANGED
@@ -375,10 +375,21 @@ declare type FillableKeys<TDef extends ModelDefinition> = {
375
375
  * The database's own nullability is still the authority: writing null to a NOT
376
376
  * NULL column fails there, as it should.
377
377
  */
378
- declare type FillableAttributes<TDef extends ModelDefinition> = Partial<Pick<
379
- { [K in keyof ModelAttributes<TDef>]: ModelAttributes<TDef>[K] | null },
378
+ type FillableAttributes<TDef extends ModelDefinition> = Partial<Pick<
379
+ {
380
+ [K in keyof ModelAttributes<TDef>]:
381
+ // Already nullable: nothing to add.
382
+ null extends ModelAttributes<TDef>[K]
383
+ ? ModelAttributes<TDef>[K]
384
+ // Optional, so the column is nullable in the database: `null` is how a
385
+ // write CLEARS it, which is different from omitting the key.
386
+ : undefined extends ModelAttributes<TDef>[K]
387
+ ? ModelAttributes<TDef>[K] | null
388
+ // Required: null stays rejected, as the NOT NULL column would reject it.
389
+ : ModelAttributes<TDef>[K]
390
+ },
380
391
  FillableKeys<TDef> | SnakeCase<FillableKeys<TDef>> | BelongsToKeys<TDef>
381
- >>;
392
+ >>
382
393
  // Numeric attribute columns - constrains aggregate methods (sum, avg, etc.)
383
394
  declare type NumericColumns<TDef extends ModelDefinition> = {
384
395
  [K in AttributeKeys<TDef>]: InferAttributeType<TDef['attributes'][K]> extends number ? K : never
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bun-query-builder",
3
3
  "type": "module",
4
- "version": "0.2.40",
4
+ "version": "0.2.41",
5
5
  "description": "A simple yet performant query builder for TypeScript. Built with Bun.",
6
6
  "author": "Chris Breuer <chris@stacksjs.org>",
7
7
  "license": "MIT",