@llmops/core 0.2.11 → 0.2.12-beta.1
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/{bun-sqlite-dialect-t1xHHJDz.cjs → bun-sqlite-dialect-Bxz4B97L.cjs} +1 -1
- package/dist/db/index.cjs +4 -1
- package/dist/db/index.d.cts +2 -2
- package/dist/db/index.d.mts +2 -2
- package/dist/db/index.mjs +3 -2
- package/dist/{db-CqDD6Ydv.cjs → db-BOe6mM51.cjs} +94 -57
- package/dist/{db-BGDhJROC.mjs → db-DohlAqJU.mjs} +94 -57
- package/dist/{index-BUlmWTh7.d.cts → index-BO5Rse5J.d.mts} +28 -7
- package/dist/{index-CkrtLH8W.d.mts → index-DwZhaRvQ.d.cts} +28 -7
- package/dist/index.cjs +4 -1
- package/dist/index.d.cts +493 -493
- package/dist/index.d.mts +493 -493
- package/dist/index.mjs +3 -2
- package/dist/neon-dialect-BQey5lUw.cjs +42 -0
- package/dist/neon-dialect-C0GZuGot.cjs +3 -0
- package/dist/neon-dialect-DySGBYUi.mjs +30 -0
- package/dist/neon-dialect-Hmo08nUq.mjs +3 -0
- package/dist/{node-sqlite-dialect-D4V5e49r.cjs → node-sqlite-dialect-N8j5UsT-.cjs} +1 -1
- package/package.json +7 -2
- /package/dist/{bun-sqlite-dialect-YVmcpOaa.mjs → bun-sqlite-dialect-CHpTFgAo.mjs} +0 -0
- /package/dist/{node-sqlite-dialect-rrsskSJp.mjs → node-sqlite-dialect-B5oKhOm1.mjs} +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ColumnType, Generated, Kysely, MssqlDialect, MysqlDialect, PostgresDialect, SqliteDialect } from "kysely";
|
|
1
|
+
import { ColumnType, Dialect, Generated, Kysely, MssqlDialect, MysqlDialect, PostgresDialect, SqliteDialect } from "kysely";
|
|
2
|
+
import { NeonQueryFunction } from "@neondatabase/serverless";
|
|
2
3
|
import * as zod0 from "zod";
|
|
3
4
|
import { z } from "zod";
|
|
4
5
|
|
|
@@ -1358,7 +1359,6 @@ declare function parsePartialTableData<T extends TableName>(table: T, data: unkn
|
|
|
1358
1359
|
};
|
|
1359
1360
|
//#endregion
|
|
1360
1361
|
//#region src/db/migrations.d.ts
|
|
1361
|
-
type DatabaseType$1 = 'postgres' | 'mysql' | 'sqlite' | 'mssql';
|
|
1362
1362
|
/**
|
|
1363
1363
|
* Options for migration operations
|
|
1364
1364
|
*/
|
|
@@ -1370,7 +1370,7 @@ interface MigrationOptions {
|
|
|
1370
1370
|
schema?: string;
|
|
1371
1371
|
rawConnection?: unknown;
|
|
1372
1372
|
}
|
|
1373
|
-
declare function matchType(columnDataType: string, fieldType: string, dbType: DatabaseType
|
|
1373
|
+
declare function matchType(columnDataType: string, fieldType: string, dbType: DatabaseType): boolean;
|
|
1374
1374
|
interface MigrationResult {
|
|
1375
1375
|
toBeCreated: Array<{
|
|
1376
1376
|
table: string;
|
|
@@ -1387,7 +1387,7 @@ interface MigrationResult {
|
|
|
1387
1387
|
migrations: any[];
|
|
1388
1388
|
needsMigration: boolean;
|
|
1389
1389
|
}
|
|
1390
|
-
declare function getMigrations(db: Kysely<Database>, dbType: DatabaseType
|
|
1390
|
+
declare function getMigrations(db: Kysely<Database>, dbType: DatabaseType, options?: MigrationOptions): Promise<MigrationResult>;
|
|
1391
1391
|
/**
|
|
1392
1392
|
* Run migrations if needed
|
|
1393
1393
|
* @param db - Kysely database instance
|
|
@@ -1395,17 +1395,35 @@ declare function getMigrations(db: Kysely<Database>, dbType: DatabaseType$1, opt
|
|
|
1395
1395
|
* @param options - Migration options (schema, etc.)
|
|
1396
1396
|
* @returns true if migrations were run, false otherwise
|
|
1397
1397
|
*/
|
|
1398
|
-
declare function runAutoMigrations(db: Kysely<Database>, dbType: DatabaseType
|
|
1398
|
+
declare function runAutoMigrations(db: Kysely<Database>, dbType: DatabaseType, options?: MigrationOptions): Promise<{
|
|
1399
1399
|
ran: boolean;
|
|
1400
1400
|
tables: string[];
|
|
1401
1401
|
fields: string[];
|
|
1402
1402
|
}>;
|
|
1403
1403
|
//#endregion
|
|
1404
|
+
//#region src/db/neon-dialect.d.ts
|
|
1405
|
+
/**
|
|
1406
|
+
* Create a Neon serverless dialect for Kysely
|
|
1407
|
+
*
|
|
1408
|
+
* @param neonInstance - Neon database query function
|
|
1409
|
+
* @returns Kysely dialect configured for Neon serverless
|
|
1410
|
+
*/
|
|
1411
|
+
declare function createNeonDialect(neonInstance: NeonQueryFunction<false, false>): any;
|
|
1412
|
+
/**
|
|
1413
|
+
* Execute a query with search_path set for Neon serverless
|
|
1414
|
+
*
|
|
1415
|
+
* @param neonInstance - Neon database query function
|
|
1416
|
+
* @param query - SQL query to execute
|
|
1417
|
+
* @param schema - Schema to set (optional)
|
|
1418
|
+
* @returns Query result
|
|
1419
|
+
*/
|
|
1420
|
+
declare function executeWithSchema(neonInstance: NeonQueryFunction<false, false>, query: string, schema?: string): Promise<any>;
|
|
1421
|
+
//#endregion
|
|
1404
1422
|
//#region src/db/index.d.ts
|
|
1405
1423
|
/**
|
|
1406
1424
|
* Supported database types
|
|
1407
1425
|
*/
|
|
1408
|
-
type DatabaseType = 'postgres' | 'mysql' | 'sqlite' | 'mssql';
|
|
1426
|
+
type DatabaseType = 'postgres' | 'mysql' | 'sqlite' | 'mssql' | 'neon';
|
|
1409
1427
|
/**
|
|
1410
1428
|
* Options for creating a database connection
|
|
1411
1429
|
*/
|
|
@@ -1431,6 +1449,9 @@ type DatabaseConnection = {
|
|
|
1431
1449
|
} | {
|
|
1432
1450
|
type: 'mssql';
|
|
1433
1451
|
dialect: MssqlDialect;
|
|
1452
|
+
} | {
|
|
1453
|
+
type: 'neon';
|
|
1454
|
+
dialect: Dialect;
|
|
1434
1455
|
} | {
|
|
1435
1456
|
type: DatabaseType;
|
|
1436
1457
|
kysely: Kysely<Database>;
|
|
@@ -1451,4 +1472,4 @@ declare function detectDatabaseType(db: unknown): DatabaseType | null;
|
|
|
1451
1472
|
*/
|
|
1452
1473
|
declare function createDatabaseFromConnection(rawConnection: any, options?: DatabaseOptions): Promise<Kysely<Database> | null>;
|
|
1453
1474
|
//#endregion
|
|
1454
|
-
export {
|
|
1475
|
+
export { variantsSchema as $, ProviderConfig as A, VariantVersionsTable as B, Environment as C, Insertable as D, EnvironmentsTable as E, TargetingRule as F, configsSchema as G, WorkspaceSettings as H, TargetingRulesTable as I, llmRequestsSchema as J, environmentSecretsSchema as K, Updateable as L, SCHEMA_METADATA as M, Selectable as N, LLMRequest as O, TableName as P, variantVersionsSchema as Q, Variant as R, Database as S, EnvironmentSecretsTable as T, WorkspaceSettingsTable as U, VariantsTable as V, configVariantsSchema as W, schemas as X, providerConfigsSchema as Y, targetingRulesSchema as Z, validateTableData as _, createDatabaseFromConnection as a, ConfigVariantsTable as b, executeWithSchema as c, getMigrations as d, workspaceSettingsSchema as et, matchType as f, validatePartialTableData as g, parseTableData as h, createDatabase as i, ProviderConfigsTable as j, LLMRequestsTable as k, MigrationOptions as l, parsePartialTableData as m, DatabaseOptions as n, detectDatabaseType as o, runAutoMigrations as p, environmentsSchema as q, DatabaseType as r, createNeonDialect as s, DatabaseConnection as t, MigrationResult as u, Config as v, EnvironmentSecret as w, ConfigsTable as x, ConfigVariant as y, VariantVersion as z };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { ColumnType, Generated, Kysely, MssqlDialect, MysqlDialect, PostgresDialect, SqliteDialect } from "kysely";
|
|
1
|
+
import { ColumnType, Dialect, Generated, Kysely, MssqlDialect, MysqlDialect, PostgresDialect, SqliteDialect } from "kysely";
|
|
2
2
|
import * as zod497 from "zod";
|
|
3
3
|
import { z } from "zod";
|
|
4
|
+
import { NeonQueryFunction } from "@neondatabase/serverless";
|
|
4
5
|
|
|
5
6
|
//#region src/db/schema.d.ts
|
|
6
7
|
declare const configsSchema: z.ZodObject<{
|
|
@@ -1358,7 +1359,6 @@ declare function parsePartialTableData<T extends TableName>(table: T, data: unkn
|
|
|
1358
1359
|
};
|
|
1359
1360
|
//#endregion
|
|
1360
1361
|
//#region src/db/migrations.d.ts
|
|
1361
|
-
type DatabaseType$1 = 'postgres' | 'mysql' | 'sqlite' | 'mssql';
|
|
1362
1362
|
/**
|
|
1363
1363
|
* Options for migration operations
|
|
1364
1364
|
*/
|
|
@@ -1370,7 +1370,7 @@ interface MigrationOptions {
|
|
|
1370
1370
|
schema?: string;
|
|
1371
1371
|
rawConnection?: unknown;
|
|
1372
1372
|
}
|
|
1373
|
-
declare function matchType(columnDataType: string, fieldType: string, dbType: DatabaseType
|
|
1373
|
+
declare function matchType(columnDataType: string, fieldType: string, dbType: DatabaseType): boolean;
|
|
1374
1374
|
interface MigrationResult {
|
|
1375
1375
|
toBeCreated: Array<{
|
|
1376
1376
|
table: string;
|
|
@@ -1387,7 +1387,7 @@ interface MigrationResult {
|
|
|
1387
1387
|
migrations: any[];
|
|
1388
1388
|
needsMigration: boolean;
|
|
1389
1389
|
}
|
|
1390
|
-
declare function getMigrations(db: Kysely<Database>, dbType: DatabaseType
|
|
1390
|
+
declare function getMigrations(db: Kysely<Database>, dbType: DatabaseType, options?: MigrationOptions): Promise<MigrationResult>;
|
|
1391
1391
|
/**
|
|
1392
1392
|
* Run migrations if needed
|
|
1393
1393
|
* @param db - Kysely database instance
|
|
@@ -1395,17 +1395,35 @@ declare function getMigrations(db: Kysely<Database>, dbType: DatabaseType$1, opt
|
|
|
1395
1395
|
* @param options - Migration options (schema, etc.)
|
|
1396
1396
|
* @returns true if migrations were run, false otherwise
|
|
1397
1397
|
*/
|
|
1398
|
-
declare function runAutoMigrations(db: Kysely<Database>, dbType: DatabaseType
|
|
1398
|
+
declare function runAutoMigrations(db: Kysely<Database>, dbType: DatabaseType, options?: MigrationOptions): Promise<{
|
|
1399
1399
|
ran: boolean;
|
|
1400
1400
|
tables: string[];
|
|
1401
1401
|
fields: string[];
|
|
1402
1402
|
}>;
|
|
1403
1403
|
//#endregion
|
|
1404
|
+
//#region src/db/neon-dialect.d.ts
|
|
1405
|
+
/**
|
|
1406
|
+
* Create a Neon serverless dialect for Kysely
|
|
1407
|
+
*
|
|
1408
|
+
* @param neonInstance - Neon database query function
|
|
1409
|
+
* @returns Kysely dialect configured for Neon serverless
|
|
1410
|
+
*/
|
|
1411
|
+
declare function createNeonDialect(neonInstance: NeonQueryFunction<false, false>): any;
|
|
1412
|
+
/**
|
|
1413
|
+
* Execute a query with search_path set for Neon serverless
|
|
1414
|
+
*
|
|
1415
|
+
* @param neonInstance - Neon database query function
|
|
1416
|
+
* @param query - SQL query to execute
|
|
1417
|
+
* @param schema - Schema to set (optional)
|
|
1418
|
+
* @returns Query result
|
|
1419
|
+
*/
|
|
1420
|
+
declare function executeWithSchema(neonInstance: NeonQueryFunction<false, false>, query: string, schema?: string): Promise<any>;
|
|
1421
|
+
//#endregion
|
|
1404
1422
|
//#region src/db/index.d.ts
|
|
1405
1423
|
/**
|
|
1406
1424
|
* Supported database types
|
|
1407
1425
|
*/
|
|
1408
|
-
type DatabaseType = 'postgres' | 'mysql' | 'sqlite' | 'mssql';
|
|
1426
|
+
type DatabaseType = 'postgres' | 'mysql' | 'sqlite' | 'mssql' | 'neon';
|
|
1409
1427
|
/**
|
|
1410
1428
|
* Options for creating a database connection
|
|
1411
1429
|
*/
|
|
@@ -1431,6 +1449,9 @@ type DatabaseConnection = {
|
|
|
1431
1449
|
} | {
|
|
1432
1450
|
type: 'mssql';
|
|
1433
1451
|
dialect: MssqlDialect;
|
|
1452
|
+
} | {
|
|
1453
|
+
type: 'neon';
|
|
1454
|
+
dialect: Dialect;
|
|
1434
1455
|
} | {
|
|
1435
1456
|
type: DatabaseType;
|
|
1436
1457
|
kysely: Kysely<Database>;
|
|
@@ -1451,4 +1472,4 @@ declare function detectDatabaseType(db: unknown): DatabaseType | null;
|
|
|
1451
1472
|
*/
|
|
1452
1473
|
declare function createDatabaseFromConnection(rawConnection: any, options?: DatabaseOptions): Promise<Kysely<Database> | null>;
|
|
1453
1474
|
//#endregion
|
|
1454
|
-
export {
|
|
1475
|
+
export { variantsSchema as $, ProviderConfig as A, VariantVersionsTable as B, Environment as C, Insertable as D, EnvironmentsTable as E, TargetingRule as F, configsSchema as G, WorkspaceSettings as H, TargetingRulesTable as I, llmRequestsSchema as J, environmentSecretsSchema as K, Updateable as L, SCHEMA_METADATA as M, Selectable as N, LLMRequest as O, TableName as P, variantVersionsSchema as Q, Variant as R, Database as S, EnvironmentSecretsTable as T, WorkspaceSettingsTable as U, VariantsTable as V, configVariantsSchema as W, schemas as X, providerConfigsSchema as Y, targetingRulesSchema as Z, validateTableData as _, createDatabaseFromConnection as a, ConfigVariantsTable as b, executeWithSchema as c, getMigrations as d, workspaceSettingsSchema as et, matchType as f, validatePartialTableData as g, parseTableData as h, createDatabase as i, ProviderConfigsTable as j, LLMRequestsTable as k, MigrationOptions as l, parsePartialTableData as m, DatabaseOptions as n, detectDatabaseType as o, runAutoMigrations as p, environmentsSchema as q, DatabaseType as r, createNeonDialect as s, DatabaseConnection as t, MigrationResult as u, Config as v, EnvironmentSecret as w, ConfigsTable as x, ConfigVariant as y, VariantVersion as z };
|
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
const require_db = require('./db-
|
|
1
|
+
const require_db = require('./db-BOe6mM51.cjs');
|
|
2
|
+
const require_neon_dialect = require('./neon-dialect-BQey5lUw.cjs');
|
|
2
3
|
let __llmops_gateway = require("@llmops/gateway");
|
|
3
4
|
__llmops_gateway = require_db.__toESM(__llmops_gateway);
|
|
4
5
|
let kysely = require("kysely");
|
|
@@ -2595,12 +2596,14 @@ exports.createDataLayer = createDataLayer;
|
|
|
2595
2596
|
exports.createDatabase = require_db.createDatabase;
|
|
2596
2597
|
exports.createDatabaseFromConnection = require_db.createDatabaseFromConnection;
|
|
2597
2598
|
exports.createLLMRequestsDataLayer = createLLMRequestsDataLayer;
|
|
2599
|
+
exports.createNeonDialect = require_neon_dialect.createNeonDialect;
|
|
2598
2600
|
exports.createProviderConfigsDataLayer = createProviderConfigsDataLayer;
|
|
2599
2601
|
exports.createWorkspaceSettingsDataLayer = createWorkspaceSettingsDataLayer;
|
|
2600
2602
|
exports.detectDatabaseType = require_db.detectDatabaseType;
|
|
2601
2603
|
exports.dollarsToMicroDollars = dollarsToMicroDollars;
|
|
2602
2604
|
exports.environmentSecretsSchema = require_db.environmentSecretsSchema;
|
|
2603
2605
|
exports.environmentsSchema = require_db.environmentsSchema;
|
|
2606
|
+
exports.executeWithSchema = require_neon_dialect.executeWithSchema;
|
|
2604
2607
|
exports.formatCost = formatCost;
|
|
2605
2608
|
Object.defineProperty(exports, 'gateway', {
|
|
2606
2609
|
enumerable: true,
|