burnless 0.1.0
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/LICENSE +204 -0
- package/dist/ai-catalog-6AA75OA3.js +18 -0
- package/dist/ai-provider-ops-3342GI65.js +39 -0
- package/dist/chunk-BMDIVUSL.js +49 -0
- package/dist/chunk-BN3QFA6Z.js +98 -0
- package/dist/chunk-CFKTW5EF.js +50 -0
- package/dist/chunk-I5ODYEMY.js +131 -0
- package/dist/chunk-IBT7EFKB.js +226 -0
- package/dist/chunk-KSP7MJZ3.js +4075 -0
- package/dist/chunk-L24B5MJD.js +25032 -0
- package/dist/chunk-M7YWG4WP.js +32 -0
- package/dist/chunk-MHVBJUPX.js +2133 -0
- package/dist/chunk-N7IP6VPJ.js +119 -0
- package/dist/chunk-OYCC45VC.js +35 -0
- package/dist/chunk-RDP4RLLI.js +6325 -0
- package/dist/chunk-VKDF3OUE.js +27 -0
- package/dist/first-run-ai-SP5SERHZ.js +53 -0
- package/dist/index.js +1550 -0
- package/dist/index.thin.js +42 -0
- package/dist/pglite-KKF2QVEJ.js +222 -0
- package/dist/postgres-js-SQJTBL3M.js +24 -0
- package/dist/prompt-QYBNOJ26.js +14 -0
- package/dist/release-4OJIQHQH.js +32 -0
- package/dist/src-ADT5KSGE.js +611 -0
- package/dist/src-LUBD7RKO.js +14 -0
- package/package.json +40 -0
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
4
|
+
import { dirname as __pathDirname } from 'node:path';
|
|
5
|
+
const require = __createRequire(import.meta.url);
|
|
6
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __pathDirname(__filename);
|
|
8
|
+
import {
|
|
9
|
+
src_default
|
|
10
|
+
} from "./chunk-MHVBJUPX.js";
|
|
11
|
+
import {
|
|
12
|
+
DefaultLogger,
|
|
13
|
+
NoopLogger,
|
|
14
|
+
PgDatabase,
|
|
15
|
+
PgDialect,
|
|
16
|
+
PgPreparedQuery,
|
|
17
|
+
PgSession,
|
|
18
|
+
PgTransaction,
|
|
19
|
+
createTableRelationsHelpers,
|
|
20
|
+
entityKind,
|
|
21
|
+
extractTablesRelationalConfig,
|
|
22
|
+
fillPlaceholders,
|
|
23
|
+
isConfig,
|
|
24
|
+
mapResultRow,
|
|
25
|
+
tracer
|
|
26
|
+
} from "./chunk-RDP4RLLI.js";
|
|
27
|
+
|
|
28
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.38.4_@electric-sql+pglite@0.5.2_@opentelemetry+api@1.9.0_@types+pg@8.15.6_75139cca41f10c6d94ac9ad65d4511ab/node_modules/drizzle-orm/postgres-js/session.js
|
|
29
|
+
var PostgresJsPreparedQuery = class extends PgPreparedQuery {
|
|
30
|
+
constructor(client, queryString, params, logger, fields, _isResponseInArrayMode, customResultMapper) {
|
|
31
|
+
super({ sql: queryString, params });
|
|
32
|
+
this.client = client;
|
|
33
|
+
this.queryString = queryString;
|
|
34
|
+
this.params = params;
|
|
35
|
+
this.logger = logger;
|
|
36
|
+
this.fields = fields;
|
|
37
|
+
this._isResponseInArrayMode = _isResponseInArrayMode;
|
|
38
|
+
this.customResultMapper = customResultMapper;
|
|
39
|
+
}
|
|
40
|
+
static [entityKind] = "PostgresJsPreparedQuery";
|
|
41
|
+
async execute(placeholderValues = {}) {
|
|
42
|
+
return tracer.startActiveSpan("drizzle.execute", async (span) => {
|
|
43
|
+
const params = fillPlaceholders(this.params, placeholderValues);
|
|
44
|
+
span?.setAttributes({
|
|
45
|
+
"drizzle.query.text": this.queryString,
|
|
46
|
+
"drizzle.query.params": JSON.stringify(params)
|
|
47
|
+
});
|
|
48
|
+
this.logger.logQuery(this.queryString, params);
|
|
49
|
+
const { fields, queryString: query, client, joinsNotNullableMap, customResultMapper } = this;
|
|
50
|
+
if (!fields && !customResultMapper) {
|
|
51
|
+
return tracer.startActiveSpan("drizzle.driver.execute", () => {
|
|
52
|
+
return client.unsafe(query, params);
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
const rows = await tracer.startActiveSpan("drizzle.driver.execute", () => {
|
|
56
|
+
span?.setAttributes({
|
|
57
|
+
"drizzle.query.text": query,
|
|
58
|
+
"drizzle.query.params": JSON.stringify(params)
|
|
59
|
+
});
|
|
60
|
+
return client.unsafe(query, params).values();
|
|
61
|
+
});
|
|
62
|
+
return tracer.startActiveSpan("drizzle.mapResponse", () => {
|
|
63
|
+
return customResultMapper ? customResultMapper(rows) : rows.map((row) => mapResultRow(fields, row, joinsNotNullableMap));
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
all(placeholderValues = {}) {
|
|
68
|
+
return tracer.startActiveSpan("drizzle.execute", async (span) => {
|
|
69
|
+
const params = fillPlaceholders(this.params, placeholderValues);
|
|
70
|
+
span?.setAttributes({
|
|
71
|
+
"drizzle.query.text": this.queryString,
|
|
72
|
+
"drizzle.query.params": JSON.stringify(params)
|
|
73
|
+
});
|
|
74
|
+
this.logger.logQuery(this.queryString, params);
|
|
75
|
+
return tracer.startActiveSpan("drizzle.driver.execute", () => {
|
|
76
|
+
span?.setAttributes({
|
|
77
|
+
"drizzle.query.text": this.queryString,
|
|
78
|
+
"drizzle.query.params": JSON.stringify(params)
|
|
79
|
+
});
|
|
80
|
+
return this.client.unsafe(this.queryString, params);
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
/** @internal */
|
|
85
|
+
isResponseInArrayMode() {
|
|
86
|
+
return this._isResponseInArrayMode;
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
var PostgresJsSession = class _PostgresJsSession extends PgSession {
|
|
90
|
+
constructor(client, dialect, schema, options = {}) {
|
|
91
|
+
super(dialect);
|
|
92
|
+
this.client = client;
|
|
93
|
+
this.schema = schema;
|
|
94
|
+
this.options = options;
|
|
95
|
+
this.logger = options.logger ?? new NoopLogger();
|
|
96
|
+
}
|
|
97
|
+
static [entityKind] = "PostgresJsSession";
|
|
98
|
+
logger;
|
|
99
|
+
prepareQuery(query, fields, name, isResponseInArrayMode, customResultMapper) {
|
|
100
|
+
return new PostgresJsPreparedQuery(
|
|
101
|
+
this.client,
|
|
102
|
+
query.sql,
|
|
103
|
+
query.params,
|
|
104
|
+
this.logger,
|
|
105
|
+
fields,
|
|
106
|
+
isResponseInArrayMode,
|
|
107
|
+
customResultMapper
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
query(query, params) {
|
|
111
|
+
this.logger.logQuery(query, params);
|
|
112
|
+
return this.client.unsafe(query, params).values();
|
|
113
|
+
}
|
|
114
|
+
queryObjects(query, params) {
|
|
115
|
+
return this.client.unsafe(query, params);
|
|
116
|
+
}
|
|
117
|
+
transaction(transaction, config) {
|
|
118
|
+
return this.client.begin(async (client) => {
|
|
119
|
+
const session = new _PostgresJsSession(
|
|
120
|
+
client,
|
|
121
|
+
this.dialect,
|
|
122
|
+
this.schema,
|
|
123
|
+
this.options
|
|
124
|
+
);
|
|
125
|
+
const tx = new PostgresJsTransaction(this.dialect, session, this.schema);
|
|
126
|
+
if (config) {
|
|
127
|
+
await tx.setTransaction(config);
|
|
128
|
+
}
|
|
129
|
+
return transaction(tx);
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
var PostgresJsTransaction = class _PostgresJsTransaction extends PgTransaction {
|
|
134
|
+
constructor(dialect, session, schema, nestedIndex = 0) {
|
|
135
|
+
super(dialect, session, schema, nestedIndex);
|
|
136
|
+
this.session = session;
|
|
137
|
+
}
|
|
138
|
+
static [entityKind] = "PostgresJsTransaction";
|
|
139
|
+
transaction(transaction) {
|
|
140
|
+
return this.session.client.savepoint((client) => {
|
|
141
|
+
const session = new PostgresJsSession(
|
|
142
|
+
client,
|
|
143
|
+
this.dialect,
|
|
144
|
+
this.schema,
|
|
145
|
+
this.session.options
|
|
146
|
+
);
|
|
147
|
+
const tx = new _PostgresJsTransaction(this.dialect, session, this.schema);
|
|
148
|
+
return transaction(tx);
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.38.4_@electric-sql+pglite@0.5.2_@opentelemetry+api@1.9.0_@types+pg@8.15.6_75139cca41f10c6d94ac9ad65d4511ab/node_modules/drizzle-orm/postgres-js/driver.js
|
|
154
|
+
var PostgresJsDatabase = class extends PgDatabase {
|
|
155
|
+
static [entityKind] = "PostgresJsDatabase";
|
|
156
|
+
};
|
|
157
|
+
function construct(client, config = {}) {
|
|
158
|
+
const transparentParser = (val) => val;
|
|
159
|
+
for (const type of ["1184", "1082", "1083", "1114"]) {
|
|
160
|
+
client.options.parsers[type] = transparentParser;
|
|
161
|
+
client.options.serializers[type] = transparentParser;
|
|
162
|
+
}
|
|
163
|
+
client.options.serializers["114"] = transparentParser;
|
|
164
|
+
client.options.serializers["3802"] = transparentParser;
|
|
165
|
+
const dialect = new PgDialect({ casing: config.casing });
|
|
166
|
+
let logger;
|
|
167
|
+
if (config.logger === true) {
|
|
168
|
+
logger = new DefaultLogger();
|
|
169
|
+
} else if (config.logger !== false) {
|
|
170
|
+
logger = config.logger;
|
|
171
|
+
}
|
|
172
|
+
let schema;
|
|
173
|
+
if (config.schema) {
|
|
174
|
+
const tablesConfig = extractTablesRelationalConfig(
|
|
175
|
+
config.schema,
|
|
176
|
+
createTableRelationsHelpers
|
|
177
|
+
);
|
|
178
|
+
schema = {
|
|
179
|
+
fullSchema: config.schema,
|
|
180
|
+
schema: tablesConfig.tables,
|
|
181
|
+
tableNamesMap: tablesConfig.tableNamesMap
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
const session = new PostgresJsSession(client, dialect, schema, { logger });
|
|
185
|
+
const db = new PostgresJsDatabase(dialect, session, schema);
|
|
186
|
+
db.$client = client;
|
|
187
|
+
return db;
|
|
188
|
+
}
|
|
189
|
+
function drizzle(...params) {
|
|
190
|
+
if (typeof params[0] === "string") {
|
|
191
|
+
const instance = src_default(params[0]);
|
|
192
|
+
return construct(instance, params[1]);
|
|
193
|
+
}
|
|
194
|
+
if (isConfig(params[0])) {
|
|
195
|
+
const { connection, client, ...drizzleConfig } = params[0];
|
|
196
|
+
if (client)
|
|
197
|
+
return construct(client, drizzleConfig);
|
|
198
|
+
if (typeof connection === "object" && connection.url !== void 0) {
|
|
199
|
+
const { url, ...config } = connection;
|
|
200
|
+
const instance2 = src_default(url, config);
|
|
201
|
+
return construct(instance2, drizzleConfig);
|
|
202
|
+
}
|
|
203
|
+
const instance = src_default(connection);
|
|
204
|
+
return construct(instance, drizzleConfig);
|
|
205
|
+
}
|
|
206
|
+
return construct(params[0], params[1]);
|
|
207
|
+
}
|
|
208
|
+
((drizzle2) => {
|
|
209
|
+
function mock(config) {
|
|
210
|
+
return construct({
|
|
211
|
+
options: {
|
|
212
|
+
parsers: {},
|
|
213
|
+
serializers: {}
|
|
214
|
+
}
|
|
215
|
+
}, config);
|
|
216
|
+
}
|
|
217
|
+
drizzle2.mock = mock;
|
|
218
|
+
})(drizzle || (drizzle = {}));
|
|
219
|
+
|
|
220
|
+
export {
|
|
221
|
+
PostgresJsPreparedQuery,
|
|
222
|
+
PostgresJsSession,
|
|
223
|
+
PostgresJsTransaction,
|
|
224
|
+
PostgresJsDatabase,
|
|
225
|
+
drizzle
|
|
226
|
+
};
|