Add history window controls and expand taxonomy pack support
- add 3Y/5Y/10Y financial history filtering and reorganize normalization details UI - add new fiscal taxonomy surface/income bridge/KPI packs and update Rust taxonomy loading - auto-detect Homebrew SQLite for native `sqlite-vec` in local dev/e2e with docs and env guidance
This commit is contained in:
@@ -1,11 +1,16 @@
|
||||
import { mkdirSync, rmSync } from 'node:fs';
|
||||
import { dirname, join } from 'node:path';
|
||||
import { Database } from 'bun:sqlite';
|
||||
import { ensureFinancialIngestionSchemaHealthy } from '../lib/server/db/financial-ingestion-schema';
|
||||
import { ensureLocalSqliteSchema } from '../lib/server/db/sqlite-schema-compat';
|
||||
import { mkdirSync, rmSync } from "node:fs";
|
||||
import { dirname, join } from "node:path";
|
||||
import { Database } from "bun:sqlite";
|
||||
import { ensureFinancialIngestionSchemaHealthy } from "../lib/server/db/financial-ingestion-schema";
|
||||
import { ensureLocalSqliteSchema } from "../lib/server/db/sqlite-schema-compat";
|
||||
import { applyLocalSqliteVectorEnv } from "./sqlite-vector-env";
|
||||
|
||||
export const E2E_DATABASE_PATH = join(process.cwd(), 'data', 'e2e.sqlite');
|
||||
export const E2E_WORKFLOW_DATA_DIR = join(process.cwd(), '.workflow-data', 'e2e');
|
||||
export const E2E_DATABASE_PATH = join(process.cwd(), "data", "e2e.sqlite");
|
||||
export const E2E_WORKFLOW_DATA_DIR = join(
|
||||
process.cwd(),
|
||||
".workflow-data",
|
||||
"e2e",
|
||||
);
|
||||
|
||||
type PrepareE2eDatabaseOptions = {
|
||||
databasePath?: string;
|
||||
@@ -16,6 +21,11 @@ function removeFileIfPresent(path: string) {
|
||||
rmSync(path, { force: true });
|
||||
}
|
||||
|
||||
const appliedVectorEnv = applyLocalSqliteVectorEnv(process.env);
|
||||
if (appliedVectorEnv.env !== process.env) {
|
||||
Object.assign(process.env, appliedVectorEnv.env);
|
||||
}
|
||||
|
||||
export function prepareE2eDatabase(options: PrepareE2eDatabaseOptions = {}) {
|
||||
const databasePath = options.databasePath ?? E2E_DATABASE_PATH;
|
||||
const workflowDataDir = options.workflowDataDir ?? E2E_WORKFLOW_DATA_DIR;
|
||||
@@ -30,9 +40,9 @@ export function prepareE2eDatabase(options: PrepareE2eDatabaseOptions = {}) {
|
||||
const database = new Database(databasePath, { create: true });
|
||||
|
||||
try {
|
||||
database.exec('PRAGMA foreign_keys = ON;');
|
||||
database.exec("PRAGMA foreign_keys = ON;");
|
||||
ensureLocalSqliteSchema(database);
|
||||
ensureFinancialIngestionSchemaHealthy(database, { mode: 'auto' });
|
||||
ensureFinancialIngestionSchemaHealthy(database, { mode: "auto" });
|
||||
} finally {
|
||||
database.close();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user