rads-db 0.1.94 → 0.1.95
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/integrations/node.cjs +4 -0
- package/integrations/node.d.ts +2 -1
- package/integrations/node.mjs +4 -1
- package/package.json +1 -1
package/integrations/node.cjs
CHANGED
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.generateClient = generateClient;
|
|
7
|
+
exports.getIndexDts = getIndexDts;
|
|
7
8
|
var _promises = _interopRequireDefault(require("node:fs/promises"));
|
|
8
9
|
var _nodeFs = _interopRequireDefault(require("node:fs"));
|
|
9
10
|
var _nodePath = _interopRequireDefault(require("node:path"));
|
|
@@ -182,6 +183,9 @@ function getWhereFieldsForPrimitive(schema, type, fieldKey) {
|
|
|
182
183
|
if (field.type === "boolean") {
|
|
183
184
|
return [];
|
|
184
185
|
}
|
|
186
|
+
if (field.type === "Record<string, string>") {
|
|
187
|
+
return [];
|
|
188
|
+
}
|
|
185
189
|
throw new Error(`Unknown primitive type: ${field.type}`);
|
|
186
190
|
}
|
|
187
191
|
function getWhereFieldsForString(name) {
|
package/integrations/node.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import type { GenerateClientOptions } from '@/types';
|
|
1
|
+
import type { GenerateClientNormalizedOptions, GenerateClientOptions, Schema } from '@/types';
|
|
2
2
|
export declare function generateClient(options?: GenerateClientOptions): Promise<void>;
|
|
3
|
+
export declare function getIndexDts(schema: Schema, options: GenerateClientNormalizedOptions): string;
|
package/integrations/node.mjs
CHANGED
|
@@ -56,7 +56,7 @@ export const schema = ${JSON.stringify(schema)}
|
|
|
56
56
|
);
|
|
57
57
|
console.timeEnd("[rads-db] Schema generated in");
|
|
58
58
|
}
|
|
59
|
-
function getIndexDts(schema, options) {
|
|
59
|
+
export function getIndexDts(schema, options) {
|
|
60
60
|
const imports = [];
|
|
61
61
|
const rootFields = [];
|
|
62
62
|
const whereTypes = [];
|
|
@@ -187,6 +187,9 @@ function getWhereFieldsForPrimitive(schema, type, fieldKey) {
|
|
|
187
187
|
if (field.type === "boolean") {
|
|
188
188
|
return [];
|
|
189
189
|
}
|
|
190
|
+
if (field.type === "Record<string, string>") {
|
|
191
|
+
return [];
|
|
192
|
+
}
|
|
190
193
|
throw new Error(`Unknown primitive type: ${field.type}`);
|
|
191
194
|
}
|
|
192
195
|
function getWhereFieldsForString(name) {
|