@vertz/db 0.2.10 → 0.2.11

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.
@@ -114,11 +114,16 @@ type ColumnKeysWhereNot<
114
114
  T extends ColumnRecord,
115
115
  Flag extends keyof ColumnMetadata
116
116
  > = { [K in keyof T] : T[K] extends ColumnBuilder<unknown, infer M> ? M extends Record<Flag, true> ? never : K : never }[keyof T];
117
+ /** True (distributed) if the annotations record contains at least one of the target annotations. */
118
+ type HasAnyAnnotation<
119
+ Ann,
120
+ A extends string
121
+ > = A extends keyof Ann ? Ann[A] extends true ? true : never : never;
117
122
  /** Keys of columns that do NOT have ANY of the specified annotations in `_annotations`. */
118
123
  type ColumnKeysWithoutAnyAnnotation<
119
124
  T extends ColumnRecord,
120
125
  Annotations extends string
121
- > = { [K in keyof T] : T[K] extends ColumnBuilder<unknown, infer M> ? M["_annotations"] extends Record<Annotations, true> ? never : K : never }[keyof T];
126
+ > = { [K in keyof T] : T[K] extends ColumnBuilder<unknown, infer M> ? true extends HasAnyAnnotation<M["_annotations"], Annotations> ? never : K : never }[keyof T];
122
127
  /**
123
128
  * $infer -- default SELECT type.
124
129
  * Excludes columns annotated 'hidden'. Includes everything else.
package/dist/index.d.ts CHANGED
@@ -240,11 +240,16 @@ type ColumnKeysWhereNot<
240
240
  T extends ColumnRecord,
241
241
  Flag extends keyof ColumnMetadata
242
242
  > = { [K in keyof T] : T[K] extends ColumnBuilder<unknown, infer M> ? M extends Record<Flag, true> ? never : K : never }[keyof T];
243
+ /** True (distributed) if the annotations record contains at least one of the target annotations. */
244
+ type HasAnyAnnotation<
245
+ Ann,
246
+ A extends string
247
+ > = A extends keyof Ann ? Ann[A] extends true ? true : never : never;
243
248
  /** Keys of columns that do NOT have ANY of the specified annotations in `_annotations`. */
244
249
  type ColumnKeysWithoutAnyAnnotation<
245
250
  T extends ColumnRecord,
246
251
  Annotations extends string
247
- > = { [K in keyof T] : T[K] extends ColumnBuilder<unknown, infer M> ? M["_annotations"] extends Record<Annotations, true> ? never : K : never }[keyof T];
252
+ > = { [K in keyof T] : T[K] extends ColumnBuilder<unknown, infer M> ? true extends HasAnyAnnotation<M["_annotations"], Annotations> ? never : K : never }[keyof T];
248
253
  /** Extracts the union of all annotation names present across all columns in a record. */
249
254
  type AllAnnotations<T extends ColumnRecord> = { [K in keyof T] : T[K] extends ColumnBuilder<unknown, infer M> ? keyof M["_annotations"] & string : never }[keyof T];
250
255
  /**
@@ -92,11 +92,16 @@ type ColumnKeysWhereNot<
92
92
  T extends ColumnRecord,
93
93
  Flag extends keyof ColumnMetadata
94
94
  > = { [K in keyof T] : T[K] extends ColumnBuilder<unknown, infer M> ? M extends Record<Flag, true> ? never : K : never }[keyof T];
95
+ /** True (distributed) if the annotations record contains at least one of the target annotations. */
96
+ type HasAnyAnnotation<
97
+ Ann,
98
+ A extends string
99
+ > = A extends keyof Ann ? Ann[A] extends true ? true : never : never;
95
100
  /** Keys of columns that do NOT have ANY of the specified annotations in `_annotations`. */
96
101
  type ColumnKeysWithoutAnyAnnotation<
97
102
  T extends ColumnRecord,
98
103
  Annotations extends string
99
- > = { [K in keyof T] : T[K] extends ColumnBuilder<unknown, infer M> ? M["_annotations"] extends Record<Annotations, true> ? never : K : never }[keyof T];
104
+ > = { [K in keyof T] : T[K] extends ColumnBuilder<unknown, infer M> ? true extends HasAnyAnnotation<M["_annotations"], Annotations> ? never : K : never }[keyof T];
100
105
  /**
101
106
  * $infer -- default SELECT type.
102
107
  * Excludes columns annotated 'hidden'. Includes everything else.
@@ -114,11 +114,16 @@ type ColumnKeysWhereNot<
114
114
  T extends ColumnRecord,
115
115
  Flag extends keyof ColumnMetadata
116
116
  > = { [K in keyof T] : T[K] extends ColumnBuilder<unknown, infer M> ? M extends Record<Flag, true> ? never : K : never }[keyof T];
117
+ /** True (distributed) if the annotations record contains at least one of the target annotations. */
118
+ type HasAnyAnnotation<
119
+ Ann,
120
+ A extends string
121
+ > = A extends keyof Ann ? Ann[A] extends true ? true : never : never;
117
122
  /** Keys of columns that do NOT have ANY of the specified annotations in `_annotations`. */
118
123
  type ColumnKeysWithoutAnyAnnotation<
119
124
  T extends ColumnRecord,
120
125
  Annotations extends string
121
- > = { [K in keyof T] : T[K] extends ColumnBuilder<unknown, infer M> ? M["_annotations"] extends Record<Annotations, true> ? never : K : never }[keyof T];
126
+ > = { [K in keyof T] : T[K] extends ColumnBuilder<unknown, infer M> ? true extends HasAnyAnnotation<M["_annotations"], Annotations> ? never : K : never }[keyof T];
122
127
  /**
123
128
  * $infer -- default SELECT type.
124
129
  * Excludes columns annotated 'hidden'. Includes everything else.
@@ -73,7 +73,7 @@ var require_file_uri_to_path = __commonJS((exports, module) => {
73
73
 
74
74
  // ../../node_modules/.bun/bindings@1.5.0/node_modules/bindings/bindings.js
75
75
  var require_bindings = __commonJS((exports, module) => {
76
- var __filename = "/Users/viniciusdacal/vertz-dev/vertz/node_modules/.bun/bindings@1.5.0/node_modules/bindings/bindings.js";
76
+ var __filename = "/home/runner/work/vertz/vertz/node_modules/.bun/bindings@1.5.0/node_modules/bindings/bindings.js";
77
77
  var fs = __require("fs");
78
78
  var path = __require("path");
79
79
  var fileURLToPath = require_file_uri_to_path();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vertz/db",
3
- "version": "0.2.10",
3
+ "version": "0.2.11",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "Database layer for Vertz — typed queries, migrations, codegen",
@@ -63,27 +63,26 @@
63
63
  "scripts": {
64
64
  "build": "bunup",
65
65
  "test": "bun test",
66
- "test:watch": "vitest",
67
- "typecheck": "tsc --noEmit"
66
+ "test:watch": "bun test --watch",
67
+ "typecheck": "tsc --noEmit -p tsconfig.typecheck.json"
68
68
  },
69
69
  "devDependencies": {
70
70
  "@cloudflare/workers-types": "^4.20260305.0",
71
71
  "@electric-sql/pglite": "^0.3.14",
72
72
  "@types/better-sqlite3": "^7.6.12",
73
73
  "@types/node": "^25.3.1",
74
- "@vitest/coverage-v8": "^4.0.18",
75
74
  "better-sqlite3": "^12.6.2",
75
+ "bun-types": "^1.3.10",
76
76
  "bunup": "^0.16.31",
77
77
  "postgres": "^3.4.8",
78
- "typescript": "^5.7.0",
79
- "vitest": "^4.0.18"
78
+ "typescript": "^5.7.0"
80
79
  },
81
80
  "engines": {
82
81
  "node": ">=22"
83
82
  },
84
83
  "dependencies": {
85
- "@vertz/errors": "^0.2.1",
86
- "@vertz/schema": "^0.2.4",
84
+ "@vertz/errors": "^0.2.11",
85
+ "@vertz/schema": "^0.2.11",
87
86
  "@paralleldrive/cuid2": "^3.3.0",
88
87
  "nanoid": "^5.1.5",
89
88
  "uuid": "^13.0.0"