@an5/orm 1.0.7 → 1.0.8

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.
Files changed (52) hide show
  1. package/README.md +175 -153
  2. package/dist/an5Metadata.d.ts +10 -0
  3. package/dist/an5Metadata.js +29 -0
  4. package/dist/an5Orm.d.ts +4 -1
  5. package/dist/an5Orm.js +214 -409
  6. package/dist/config.d.ts +2 -0
  7. package/dist/config.js +24 -0
  8. package/dist/errors.d.ts +14 -0
  9. package/dist/errors.js +16 -0
  10. package/dist/generator/src/code-generator.d.ts +13 -13
  11. package/dist/generator/src/code-generator.js +225 -225
  12. package/dist/generator/src/dotnet-generator.d.ts +11 -11
  13. package/dist/generator/src/dotnet-generator.js +546 -546
  14. package/dist/generator/src/index.d.ts +1 -1
  15. package/dist/generator/src/index.js +88 -88
  16. package/dist/generator/src/metadata-generator.d.ts +8 -8
  17. package/dist/generator/src/metadata-generator.js +90 -90
  18. package/dist/generator/src/parser.d.ts +11 -11
  19. package/dist/generator/src/parser.js +206 -206
  20. package/dist/generator/src/python-generator.d.ts +9 -9
  21. package/dist/generator/src/python-generator.js +105 -105
  22. package/dist/generator/src/types.d.ts +27 -27
  23. package/dist/generator/src/types.js +2 -2
  24. package/dist/index.d.ts +3 -0
  25. package/dist/index.js +5 -1
  26. package/dist/logger.d.ts +53 -0
  27. package/dist/logger.js +117 -0
  28. package/dist/metadata.d.ts +24 -0
  29. package/dist/metadata.js +15 -0
  30. package/dist/scripts/release-cli.d.ts +2 -2
  31. package/dist/scripts/release-cli.js +115 -115
  32. package/dist/sql-utils.d.ts +29 -0
  33. package/dist/sql-utils.js +220 -0
  34. package/generator/src/code-generator.ts +230 -234
  35. package/generator/src/dotnet-generator.ts +544 -544
  36. package/generator/src/index.ts +116 -104
  37. package/generator/src/metadata-generator.ts +101 -99
  38. package/generator/src/parser.ts +202 -202
  39. package/generator/src/python-generator.ts +114 -114
  40. package/generator/src/types.ts +29 -29
  41. package/package.json +2 -6
  42. package/dist/cleanup.d.ts +0 -2
  43. package/dist/cleanup.js +0 -120
  44. package/dist/cli.js +0 -64
  45. package/dist/migrate.d.ts +0 -11
  46. package/dist/migrate.js +0 -301
  47. package/dist/pull.d.ts +0 -2
  48. package/dist/pull.js +0 -339
  49. package/dist/push.d.ts +0 -2
  50. package/dist/push.js +0 -281
  51. package/dist/seed.d.ts +0 -2
  52. package/dist/seed.js +0 -401
@@ -1,27 +1,27 @@
1
- export interface Field {
2
- name: string;
3
- type: string;
4
- sqlType: string;
5
- isOptional: boolean;
6
- hasDefault: boolean;
7
- isId: boolean;
8
- description?: string;
9
- }
10
- export interface Relation {
11
- name: string;
12
- type: string;
13
- isArray: boolean;
14
- isOptional: boolean;
15
- foreignKey: string;
16
- localKey: string;
17
- relationName: string;
18
- }
19
- export interface Model {
20
- name: string;
21
- tableName: string;
22
- schemaName: string;
23
- fields: Field[];
24
- relations: Relation[];
25
- compoundUniques?: string[][];
26
- description?: string;
27
- }
1
+ export interface Field {
2
+ name: string;
3
+ type: string;
4
+ sqlType: string;
5
+ isOptional: boolean;
6
+ hasDefault: boolean;
7
+ isId: boolean;
8
+ description?: string;
9
+ }
10
+ export interface Relation {
11
+ name: string;
12
+ type: string;
13
+ isArray: boolean;
14
+ isOptional: boolean;
15
+ foreignKey: string;
16
+ localKey: string;
17
+ relationName: string;
18
+ }
19
+ export interface Model {
20
+ name: string;
21
+ tableName: string;
22
+ schemaName: string;
23
+ fields: Field[];
24
+ relations: Relation[];
25
+ compoundUniques?: string[][];
26
+ description?: string;
27
+ }
@@ -1,2 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/dist/index.d.ts CHANGED
@@ -1,3 +1,6 @@
1
1
  export { An5ORM, an5Orm, default } from "./an5Orm";
2
2
  export type { Middleware, MiddlewareParams } from "./an5Orm";
3
+ export { An5ClientKnownRequestError } from "./errors";
4
+ export { DEFAULT_METADATA } from "./metadata";
5
+ export type { RelationDef, ModelFieldMeta, An5Metadata } from "./metadata";
3
6
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -3,9 +3,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.default = exports.an5Orm = exports.An5ORM = void 0;
6
+ exports.DEFAULT_METADATA = exports.An5ClientKnownRequestError = exports.default = exports.an5Orm = exports.An5ORM = void 0;
7
7
  var an5Orm_1 = require("./an5Orm");
8
8
  Object.defineProperty(exports, "An5ORM", { enumerable: true, get: function () { return an5Orm_1.An5ORM; } });
9
9
  Object.defineProperty(exports, "an5Orm", { enumerable: true, get: function () { return an5Orm_1.an5Orm; } });
10
10
  Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(an5Orm_1).default; } });
11
+ var errors_1 = require("./errors");
12
+ Object.defineProperty(exports, "An5ClientKnownRequestError", { enumerable: true, get: function () { return errors_1.An5ClientKnownRequestError; } });
13
+ var metadata_1 = require("./metadata");
14
+ Object.defineProperty(exports, "DEFAULT_METADATA", { enumerable: true, get: function () { return metadata_1.DEFAULT_METADATA; } });
11
15
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Structured Logger for an5Orm
3
+ * Provides consistent logging with levels, timestamps, and context.
4
+ */
5
+ export type LogLevel = 'debug' | 'info' | 'warn' | 'error';
6
+ export interface LogEntry {
7
+ level: LogLevel;
8
+ message: string;
9
+ timestamp: string;
10
+ context?: string;
11
+ data?: any;
12
+ duration?: number;
13
+ error?: Error;
14
+ }
15
+ export interface LoggerOptions {
16
+ level?: LogLevel;
17
+ prefix?: string;
18
+ json?: boolean;
19
+ colors?: boolean;
20
+ }
21
+ export declare class Logger {
22
+ private level;
23
+ private prefix;
24
+ private json;
25
+ private colors;
26
+ constructor(options?: LoggerOptions);
27
+ private formatEntry;
28
+ private log;
29
+ debug(message: string, options?: {
30
+ context?: string;
31
+ data?: any;
32
+ }): void;
33
+ info(message: string, options?: {
34
+ context?: string;
35
+ data?: any;
36
+ duration?: number;
37
+ }): void;
38
+ warn(message: string, options?: {
39
+ context?: string;
40
+ data?: any;
41
+ }): void;
42
+ error(message: string, error?: Error, options?: {
43
+ context?: string;
44
+ data?: any;
45
+ }): void;
46
+ child(context: string): Logger;
47
+ timer(label: string): {
48
+ end: () => void;
49
+ };
50
+ }
51
+ export declare const logger: Logger;
52
+ export declare function createLogger(context: string): Logger;
53
+ //# sourceMappingURL=logger.d.ts.map
package/dist/logger.js ADDED
@@ -0,0 +1,117 @@
1
+ "use strict";
2
+ /**
3
+ * Structured Logger for an5Orm
4
+ * Provides consistent logging with levels, timestamps, and context.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.logger = exports.Logger = void 0;
8
+ exports.createLogger = createLogger;
9
+ const LOG_LEVELS = {
10
+ debug: 0,
11
+ info: 1,
12
+ warn: 2,
13
+ error: 3,
14
+ };
15
+ const COLORS = {
16
+ debug: '\x1b[36m', // cyan
17
+ info: '\x1b[32m', // green
18
+ warn: '\x1b[33m', // yellow
19
+ error: '\x1b[31m', // red
20
+ reset: '\x1b[0m',
21
+ };
22
+ class Logger {
23
+ constructor(options = {}) {
24
+ this.level = LOG_LEVELS[options.level || 'info'];
25
+ this.prefix = options.prefix || '';
26
+ this.json = options.json || false;
27
+ this.colors = options.colors !== false && !this.json;
28
+ }
29
+ formatEntry(entry) {
30
+ if (this.json) {
31
+ return JSON.stringify({
32
+ level: entry.level,
33
+ message: entry.message,
34
+ timestamp: entry.timestamp,
35
+ context: entry.context,
36
+ duration: entry.duration,
37
+ ...(entry.data && { data: entry.data }),
38
+ ...(entry.error && { error: entry.error.message, stack: entry.error.stack }),
39
+ });
40
+ }
41
+ const color = this.colors ? COLORS[entry.level] : '';
42
+ const reset = this.colors ? COLORS.reset : '';
43
+ const prefix = this.prefix ? `[${this.prefix}]` : '';
44
+ const context = entry.context ? `[${entry.context}]` : '';
45
+ const duration = entry.duration !== undefined ? ` (${entry.duration}ms)` : '';
46
+ const timestamp = entry.timestamp;
47
+ let line = `${color}${timestamp} ${entry.level.toUpperCase().padEnd(5)}${reset} ${prefix}${context} ${entry.message}${duration}`;
48
+ if (entry.error) {
49
+ line += `\n${color}${entry.error.stack || entry.error.message}${reset}`;
50
+ }
51
+ return line;
52
+ }
53
+ log(level, message, options) {
54
+ if (LOG_LEVELS[level] < this.level)
55
+ return;
56
+ const entry = {
57
+ level,
58
+ message,
59
+ timestamp: new Date().toISOString(),
60
+ ...options,
61
+ };
62
+ const formatted = this.formatEntry(entry);
63
+ switch (level) {
64
+ case 'error':
65
+ console.error(formatted);
66
+ break;
67
+ case 'warn':
68
+ console.warn(formatted);
69
+ break;
70
+ case 'debug':
71
+ console.debug(formatted);
72
+ break;
73
+ default:
74
+ console.log(formatted);
75
+ }
76
+ }
77
+ debug(message, options) {
78
+ this.log('debug', message, options);
79
+ }
80
+ info(message, options) {
81
+ this.log('info', message, options);
82
+ }
83
+ warn(message, options) {
84
+ this.log('warn', message, options);
85
+ }
86
+ error(message, error, options) {
87
+ this.log('error', message, { ...options, error });
88
+ }
89
+ child(context) {
90
+ return new Logger({
91
+ level: Object.keys(LOG_LEVELS).find(k => LOG_LEVELS[k] === this.level),
92
+ prefix: this.prefix ? `${this.prefix}:${context}` : context,
93
+ json: this.json,
94
+ colors: this.colors,
95
+ });
96
+ }
97
+ timer(label) {
98
+ const start = Date.now();
99
+ return {
100
+ end: () => {
101
+ const duration = Date.now() - start;
102
+ this.info(`${label} completed`, { duration });
103
+ },
104
+ };
105
+ }
106
+ }
107
+ exports.Logger = Logger;
108
+ // Default logger instance
109
+ exports.logger = new Logger({
110
+ level: process.env.LOG_LEVEL || 'info',
111
+ prefix: 'an5Orm',
112
+ });
113
+ // Create scoped loggers
114
+ function createLogger(context) {
115
+ return exports.logger.child(context);
116
+ }
117
+ //# sourceMappingURL=logger.js.map
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Core metadata types for AN5 ORM.
3
+ * These types are owned by the core package (@an5/orm) so that the ORM never
4
+ * has to import from generated client artifacts. Generated clients import
5
+ * these types from @an5/orm instead.
6
+ */
7
+ export interface RelationDef {
8
+ modelName: string;
9
+ relationType: "many" | "one";
10
+ foreignKey: string;
11
+ localKey: string;
12
+ }
13
+ export interface ModelFieldMeta {
14
+ ts: string;
15
+ sql: string;
16
+ description?: string;
17
+ }
18
+ export interface An5Metadata {
19
+ modelToTable: Record<string, string>;
20
+ relationMap: Record<string, Record<string, RelationDef>>;
21
+ modelFields: Record<string, Record<string, ModelFieldMeta>>;
22
+ }
23
+ export declare const DEFAULT_METADATA: An5Metadata;
24
+ //# sourceMappingURL=metadata.d.ts.map
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ /**
3
+ * Core metadata types for AN5 ORM.
4
+ * These types are owned by the core package (@an5/orm) so that the ORM never
5
+ * has to import from generated client artifacts. Generated clients import
6
+ * these types from @an5/orm instead.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.DEFAULT_METADATA = void 0;
10
+ exports.DEFAULT_METADATA = {
11
+ modelToTable: {},
12
+ relationMap: {},
13
+ modelFields: {},
14
+ };
15
+ //# sourceMappingURL=metadata.js.map
@@ -1,3 +1,3 @@
1
- #!/usr/bin/env tsx
2
- export {};
1
+ #!/usr/bin/env tsx
2
+ export {};
3
3
  //# sourceMappingURL=release-cli.d.ts.map
@@ -1,116 +1,116 @@
1
- #!/usr/bin/env tsx
2
- "use strict";
3
- var __importDefault = (this && this.__importDefault) || function (mod) {
4
- return (mod && mod.__esModule) ? mod : { "default": mod };
5
- };
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- const child_process_1 = require("child_process");
8
- const fs_1 = __importDefault(require("fs"));
9
- const path_1 = __importDefault(require("path"));
10
- function run(cmd, allowFail = false) {
11
- try {
12
- return (0, child_process_1.execSync)(cmd, { encoding: 'utf8' }).trim();
13
- }
14
- catch (error) {
15
- if (allowFail)
16
- return error.stdout?.toString()?.trim() || '';
17
- throw error;
18
- }
19
- }
20
- function inferComponent(file) {
21
- const normalized = file.replace('\\', '/').toLowerCase();
22
- if (normalized.includes('/generator/'))
23
- return 'generator';
24
- if (normalized.includes('/an5client/'))
25
- return 'client';
26
- if (normalized.includes('/an5schema/'))
27
- return 'schema';
28
- if (normalized.includes('/.github/'))
29
- return 'ci';
30
- if (normalized.includes('package.json') || normalized.includes('tsconfig'))
31
- return 'build';
32
- if (normalized.includes('.md'))
33
- return 'docs';
34
- return 'misc';
35
- }
36
- function collectChanges() {
37
- const status = run('git status --porcelain');
38
- const files = status
39
- .split('\n')
40
- .map(l => l.trim())
41
- .filter(Boolean)
42
- .map(l => l.slice(3).trim())
43
- .filter(Boolean);
44
- const groups = new Map();
45
- for (const file of files) {
46
- const component = inferComponent(file);
47
- if (!groups.has(component)) {
48
- groups.set(component, { component, files: [], summary: '' });
49
- }
50
- groups.get(component).files.push(file);
51
- }
52
- return Array.from(groups.values()).map(group => ({
53
- ...group,
54
- summary: `${group.component} updates`
55
- }));
56
- }
57
- function generateChangelog(groups) {
58
- const lines = ['# Changelog', ''];
59
- for (const group of groups) {
60
- lines.push(`## ${group.component}`);
61
- lines.push(`- ${group.summary}`);
62
- for (const file of group.files) {
63
- lines.push(` - ${file}`);
64
- }
65
- lines.push('');
66
- }
67
- return lines.join('\n').trim();
68
- }
69
- async function maybeUseLLM(summary) {
70
- let apiKey = '';
71
- try {
72
- const configPath = require('path').join(__dirname, '..', '..', 'an5Adapters', 'typescript', 'config');
73
- const mod = require(configPath);
74
- if (mod?.getLlmConfig) {
75
- const db = await mod.getLlmConfig();
76
- if (db)
77
- apiKey = db.apiKey;
78
- }
79
- }
80
- catch { }
81
- if (!apiKey)
82
- return summary;
83
- try {
84
- const prompt = `Summarize these changes into one concise release note in English:\n${summary}`;
85
- const payload = JSON.stringify({ model: 'gpt-4o-mini', messages: [{ role: 'system', content: 'You are a helpful release note writer.' }, { role: 'user', content: prompt }] });
86
- const response = run(`curl -s https://api.openai.com/v1/chat/completions -H "Authorization: Bearer ${apiKey}" -H "Content-Type: application/json" -d '${payload}'`, true);
87
- const parsed = JSON.parse(response);
88
- return parsed.choices?.[0]?.message?.content?.trim() || summary;
89
- }
90
- catch {
91
- return summary;
92
- }
93
- }
94
- async function main() {
95
- const groups = collectChanges();
96
- if (groups.length === 0) {
97
- console.log('No modified files detected.');
98
- process.exit(0);
99
- }
100
- const changelog = generateChangelog(groups);
101
- const outputPath = path_1.default.resolve(process.cwd(), 'CHANGELOG.md');
102
- fs_1.default.writeFileSync(outputPath, changelog + '\n');
103
- const summary = groups.map(g => `${g.component}: ${g.files.join(', ')}`).join('\n');
104
- const llmSummary = await maybeUseLLM(summary);
105
- console.log('\nGenerated changelog:\n');
106
- console.log(changelog);
107
- console.log('\nLLM summary:\n');
108
- console.log(llmSummary);
109
- const message = groups.map(g => g.component).join(', ');
110
- const commitMessage = `chore: update ${message}`;
111
- run(`git add -A`);
112
- run(`git commit -m "${commitMessage}"`, true);
113
- console.log(`\nCommitted with: ${commitMessage}`);
114
- }
115
- main().catch(console.error);
1
+ #!/usr/bin/env tsx
2
+ "use strict";
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ const child_process_1 = require("child_process");
8
+ const fs_1 = __importDefault(require("fs"));
9
+ const path_1 = __importDefault(require("path"));
10
+ function run(cmd, allowFail = false) {
11
+ try {
12
+ return (0, child_process_1.execSync)(cmd, { encoding: 'utf8' }).trim();
13
+ }
14
+ catch (error) {
15
+ if (allowFail)
16
+ return error.stdout?.toString()?.trim() || '';
17
+ throw error;
18
+ }
19
+ }
20
+ function inferComponent(file) {
21
+ const normalized = file.replace('\\', '/').toLowerCase();
22
+ if (normalized.includes('/generator/'))
23
+ return 'generator';
24
+ if (normalized.includes('/an5client/'))
25
+ return 'client';
26
+ if (normalized.includes('/an5schema/'))
27
+ return 'schema';
28
+ if (normalized.includes('/.github/'))
29
+ return 'ci';
30
+ if (normalized.includes('package.json') || normalized.includes('tsconfig'))
31
+ return 'build';
32
+ if (normalized.includes('.md'))
33
+ return 'docs';
34
+ return 'misc';
35
+ }
36
+ function collectChanges() {
37
+ const status = run('git status --porcelain');
38
+ const files = status
39
+ .split('\n')
40
+ .map(l => l.trim())
41
+ .filter(Boolean)
42
+ .map(l => l.slice(3).trim())
43
+ .filter(Boolean);
44
+ const groups = new Map();
45
+ for (const file of files) {
46
+ const component = inferComponent(file);
47
+ if (!groups.has(component)) {
48
+ groups.set(component, { component, files: [], summary: '' });
49
+ }
50
+ groups.get(component).files.push(file);
51
+ }
52
+ return Array.from(groups.values()).map(group => ({
53
+ ...group,
54
+ summary: `${group.component} updates`
55
+ }));
56
+ }
57
+ function generateChangelog(groups) {
58
+ const lines = ['# Changelog', ''];
59
+ for (const group of groups) {
60
+ lines.push(`## ${group.component}`);
61
+ lines.push(`- ${group.summary}`);
62
+ for (const file of group.files) {
63
+ lines.push(` - ${file}`);
64
+ }
65
+ lines.push('');
66
+ }
67
+ return lines.join('\n').trim();
68
+ }
69
+ async function maybeUseLLM(summary) {
70
+ let apiKey = '';
71
+ try {
72
+ const configPath = require('path').join(__dirname, '..', '..', 'an5Adapters', 'typescript', 'config');
73
+ const mod = require(configPath);
74
+ if (mod?.getLlmConfig) {
75
+ const db = await mod.getLlmConfig();
76
+ if (db)
77
+ apiKey = db.apiKey;
78
+ }
79
+ }
80
+ catch { }
81
+ if (!apiKey)
82
+ return summary;
83
+ try {
84
+ const prompt = `Summarize these changes into one concise release note in English:\n${summary}`;
85
+ const payload = JSON.stringify({ model: 'gpt-4o-mini', messages: [{ role: 'system', content: 'You are a helpful release note writer.' }, { role: 'user', content: prompt }] });
86
+ const response = run(`curl -s https://api.openai.com/v1/chat/completions -H "Authorization: Bearer ${apiKey}" -H "Content-Type: application/json" -d '${payload}'`, true);
87
+ const parsed = JSON.parse(response);
88
+ return parsed.choices?.[0]?.message?.content?.trim() || summary;
89
+ }
90
+ catch {
91
+ return summary;
92
+ }
93
+ }
94
+ async function main() {
95
+ const groups = collectChanges();
96
+ if (groups.length === 0) {
97
+ console.log('No modified files detected.');
98
+ process.exit(0);
99
+ }
100
+ const changelog = generateChangelog(groups);
101
+ const outputPath = path_1.default.resolve(process.cwd(), 'CHANGELOG.md');
102
+ fs_1.default.writeFileSync(outputPath, changelog + '\n');
103
+ const summary = groups.map(g => `${g.component}: ${g.files.join(', ')}`).join('\n');
104
+ const llmSummary = await maybeUseLLM(summary);
105
+ console.log('\nGenerated changelog:\n');
106
+ console.log(changelog);
107
+ console.log('\nLLM summary:\n');
108
+ console.log(llmSummary);
109
+ const message = groups.map(g => g.component).join(', ');
110
+ const commitMessage = `chore: update ${message}`;
111
+ run(`git add -A`);
112
+ run(`git commit -m "${commitMessage}"`, true);
113
+ console.log(`\nCommitted with: ${commitMessage}`);
114
+ }
115
+ main().catch(console.error);
116
116
  //# sourceMappingURL=release-cli.js.map
@@ -0,0 +1,29 @@
1
+ import type { RelationDef } from "./metadata";
2
+ /**
3
+ * SQL Server identifier quoting.
4
+ *
5
+ * Wraps a bare identifier in square brackets and escapes any embedded
6
+ * closing bracket (`]` → `]]`), which is the only character that can break
7
+ * out of a bracketed identifier in T-SQL. This blocks SQL injection through
8
+ * user-supplied column / alias names.
9
+ */
10
+ export declare function quoteIdentifier(name: string): string;
11
+ /** Sanitizes a parameter name to a safe T-SQL identifier fragment. */
12
+ export declare function sanitizeParamName(name: string): string;
13
+ /** Validates a direction token, defaulting to ASC. */
14
+ export declare function normalizeSortDirection(dir: unknown): "ASC" | "DESC";
15
+ /** Coerces a value to a non-negative integer, or returns the fallback. */
16
+ export declare function toNonNegativeInt(value: unknown, fallback?: number): number;
17
+ export interface QueryContext {
18
+ relationMap?: Record<string, Record<string, RelationDef>>;
19
+ modelToTable?: Record<string, string>;
20
+ }
21
+ export declare function buildOrderBy(orderBy: any): string;
22
+ /**
23
+ * Recursively builds a WHERE clause from a Prisma-style filter object.
24
+ *
25
+ * Values are always bound as parameters (`@name`); only identifiers are
26
+ * interpolated directly, and they are run through {@link quoteIdentifier}.
27
+ */
28
+ export declare function parseWhere(modelName: string, where: any, params: Record<string, any>, prefix?: string, ctx?: QueryContext): string;
29
+ //# sourceMappingURL=sql-utils.d.ts.map