@llmops/core 0.1.0-beta.8 → 0.1.1-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-Dzur5J1r.cjs +156 -0
- package/dist/db/index.cjs +21 -0
- package/dist/db/index.d.cts +2 -0
- package/dist/db/index.d.mts +2 -2
- package/dist/db/index.mjs +2 -2
- package/dist/{db-D9v8S6D5.mjs → db-DN6gkyRp.mjs} +337 -32
- package/dist/db-gMDwCuHR.cjs +13271 -0
- package/dist/{index-D59q8KmB.d.mts → index-CG30o-6r.d.cts} +59 -2
- package/dist/index-Ddhbb3O5.d.mts +883 -0
- package/dist/index.cjs +1384 -0
- package/dist/index.d.cts +2088 -0
- package/dist/index.d.mts +335 -311
- package/dist/index.mjs +5 -8
- package/dist/node-sqlite-dialect-BTbo14Y2.cjs +156 -0
- package/package.json +23 -5
|
@@ -786,11 +786,65 @@ declare function parsePartialTableData<T extends TableName>(table: T, data: unkn
|
|
|
786
786
|
updatedAt?: Date | undefined;
|
|
787
787
|
};
|
|
788
788
|
//#endregion
|
|
789
|
+
//#region src/db/migrations.d.ts
|
|
790
|
+
type DatabaseType$1 = 'postgres' | 'mysql' | 'sqlite' | 'mssql';
|
|
791
|
+
/**
|
|
792
|
+
* Options for migration operations
|
|
793
|
+
*/
|
|
794
|
+
interface MigrationOptions {
|
|
795
|
+
/**
|
|
796
|
+
* PostgreSQL schema name to use.
|
|
797
|
+
* If provided, the schema will be created if it doesn't exist.
|
|
798
|
+
*/
|
|
799
|
+
schema?: string;
|
|
800
|
+
}
|
|
801
|
+
declare function matchType(columnDataType: string, fieldType: string, dbType: DatabaseType$1): boolean;
|
|
802
|
+
interface MigrationResult {
|
|
803
|
+
toBeCreated: Array<{
|
|
804
|
+
table: string;
|
|
805
|
+
fields: Record<string, any>;
|
|
806
|
+
order: number;
|
|
807
|
+
}>;
|
|
808
|
+
toBeAdded: Array<{
|
|
809
|
+
table: string;
|
|
810
|
+
fields: Record<string, any>;
|
|
811
|
+
order: number;
|
|
812
|
+
}>;
|
|
813
|
+
runMigrations: () => Promise<void>;
|
|
814
|
+
compileMigrations: () => Promise<string>;
|
|
815
|
+
migrations: any[];
|
|
816
|
+
needsMigration: boolean;
|
|
817
|
+
}
|
|
818
|
+
declare function getMigrations(db: Kysely<Database>, dbType: DatabaseType$1, options?: MigrationOptions): Promise<MigrationResult>;
|
|
819
|
+
/**
|
|
820
|
+
* Run migrations if needed based on autoMigrate config
|
|
821
|
+
* @param db - Kysely database instance
|
|
822
|
+
* @param dbType - Database type
|
|
823
|
+
* @param autoMigrate - Auto-migrate configuration
|
|
824
|
+
* @param options - Migration options (schema, etc.)
|
|
825
|
+
* @returns true if migrations were run, false otherwise
|
|
826
|
+
*/
|
|
827
|
+
declare function runAutoMigrations(db: Kysely<Database>, dbType: DatabaseType$1, autoMigrate: boolean | 'development', options?: MigrationOptions): Promise<{
|
|
828
|
+
ran: boolean;
|
|
829
|
+
tables: string[];
|
|
830
|
+
fields: string[];
|
|
831
|
+
}>;
|
|
832
|
+
//#endregion
|
|
789
833
|
//#region src/db/index.d.ts
|
|
790
834
|
/**
|
|
791
835
|
* Supported database types
|
|
792
836
|
*/
|
|
793
837
|
type DatabaseType = 'postgres' | 'mysql' | 'sqlite' | 'mssql';
|
|
838
|
+
/**
|
|
839
|
+
* Options for creating a database connection
|
|
840
|
+
*/
|
|
841
|
+
interface DatabaseOptions {
|
|
842
|
+
/**
|
|
843
|
+
* PostgreSQL schema name (sets search_path).
|
|
844
|
+
* Defaults to 'llmops'.
|
|
845
|
+
*/
|
|
846
|
+
schema?: string;
|
|
847
|
+
}
|
|
794
848
|
/**
|
|
795
849
|
* Database connection options
|
|
796
850
|
*/
|
|
@@ -820,7 +874,10 @@ declare function createDatabase(connection: DatabaseConnection): Kysely<Database
|
|
|
820
874
|
declare function detectDatabaseType(db: unknown): DatabaseType | null;
|
|
821
875
|
/**
|
|
822
876
|
* Create database from raw connection
|
|
877
|
+
*
|
|
878
|
+
* @param rawConnection - The raw database connection (pg Pool, sqlite Database, etc.)
|
|
879
|
+
* @param options - Optional configuration (schema for PostgreSQL)
|
|
823
880
|
*/
|
|
824
|
-
declare function createDatabaseFromConnection(rawConnection: any): Promise<Kysely<Database> | null>;
|
|
881
|
+
declare function createDatabaseFromConnection(rawConnection: any, options?: DatabaseOptions): Promise<Kysely<Database> | null>;
|
|
825
882
|
//#endregion
|
|
826
|
-
export {
|
|
883
|
+
export { TargetingRulesTable as A, schemas as B, EnvironmentSecretsTable as C, Selectable as D, SCHEMA_METADATA as E, VariantsTable as F, variantVersionsSchema as H, configVariantsSchema as I, configsSchema as L, Variant as M, VariantVersion as N, TableName as O, VariantVersionsTable as P, environmentSecretsSchema as R, EnvironmentSecret as S, Insertable as T, variantsSchema as U, targetingRulesSchema as V, ConfigVariant as _, createDatabaseFromConnection as a, Database as b, MigrationResult as c, runAutoMigrations as d, parsePartialTableData as f, Config as g, validateTableData as h, createDatabase as i, Updateable as j, TargetingRule as k, getMigrations as l, validatePartialTableData as m, DatabaseOptions as n, detectDatabaseType as o, parseTableData as p, DatabaseType as r, MigrationOptions as s, DatabaseConnection as t, matchType as u, ConfigVariantsTable as v, EnvironmentsTable as w, Environment as x, ConfigsTable as y, environmentsSchema as z };
|