zod-sqlite 1.0.1 → 1.0.2

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/index.d.cts CHANGED
@@ -158,7 +158,7 @@ type ForeignKeyReference = {
158
158
  * where: 'status = "active"'
159
159
  * }
160
160
  */
161
- type IndexConfig = {
161
+ type IndexConfig<TColumns extends readonly ColumnConfig<string, zod.$ZodType>[] = readonly ColumnConfig<string, zod.$ZodType>[]> = {
162
162
  /**
163
163
  * Unique name for the index.
164
164
  *
@@ -178,7 +178,7 @@ type IndexConfig = {
178
178
  * @example ['email'] - single column
179
179
  * @example ['last_name', 'first_name'] - composite index
180
180
  */
181
- columns: string[];
181
+ columns: ReadonlyArray<TColumns[number]['name']>;
182
182
  /**
183
183
  * Whether this is a unique index.
184
184
  *
@@ -452,7 +452,7 @@ type TableConfig<TColumns extends readonly ColumnConfig<string, zod.$ZodType>[]
452
452
  * }
453
453
  * ]
454
454
  */
455
- indexes?: IndexConfig[];
455
+ indexes?: IndexConfig<TColumns>[];
456
456
  };
457
457
 
458
458
  /**
package/dist/index.d.ts CHANGED
@@ -158,7 +158,7 @@ type ForeignKeyReference = {
158
158
  * where: 'status = "active"'
159
159
  * }
160
160
  */
161
- type IndexConfig = {
161
+ type IndexConfig<TColumns extends readonly ColumnConfig<string, zod.$ZodType>[] = readonly ColumnConfig<string, zod.$ZodType>[]> = {
162
162
  /**
163
163
  * Unique name for the index.
164
164
  *
@@ -178,7 +178,7 @@ type IndexConfig = {
178
178
  * @example ['email'] - single column
179
179
  * @example ['last_name', 'first_name'] - composite index
180
180
  */
181
- columns: string[];
181
+ columns: ReadonlyArray<TColumns[number]['name']>;
182
182
  /**
183
183
  * Whether this is a unique index.
184
184
  *
@@ -452,7 +452,7 @@ type TableConfig<TColumns extends readonly ColumnConfig<string, zod.$ZodType>[]
452
452
  * }
453
453
  * ]
454
454
  */
455
- indexes?: IndexConfig[];
455
+ indexes?: IndexConfig<TColumns>[];
456
456
  };
457
457
 
458
458
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zod-sqlite",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Generate type-safe SQLite table schemas from Zod validation schemas.",
5
5
  "private": false,
6
6
  "author": {