mirror of https://github.com/buster-so/buster.git
linting and test issues
This commit is contained in:
parent
c354a08348
commit
aa59ad8def
|
@ -310,7 +310,9 @@ export class ModelParsingError extends Error {
|
||||||
super(message);
|
super(message);
|
||||||
this.name = 'ModelParsingError';
|
this.name = 'ModelParsingError';
|
||||||
this.file = file;
|
this.file = file;
|
||||||
this.zodError = zodError;
|
if (zodError) {
|
||||||
|
this.zodError = zodError;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getDetailedMessage(): string {
|
getDetailedMessage(): string {
|
||||||
|
|
|
@ -72,7 +72,7 @@ export const createConnection = (useDisk = true): Promise<DuckDBConnection> => {
|
||||||
// The database file will be automatically cleaned up
|
// The database file will be automatically cleaned up
|
||||||
const dbPath = useDisk ? `/tmp/duckdb-dedupe-${Date.now()}.db` : ':memory:';
|
const dbPath = useDisk ? `/tmp/duckdb-dedupe-${Date.now()}.db` : ':memory:';
|
||||||
|
|
||||||
const db = new duckdb.Database(dbPath, (err) => {
|
const db = new duckdb.Database(dbPath, (err: Error | null) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
reject(new Error(`Failed to create DuckDB database: ${err.message}`));
|
reject(new Error(`Failed to create DuckDB database: ${err.message}`));
|
||||||
return;
|
return;
|
||||||
|
@ -82,10 +82,10 @@ export const createConnection = (useDisk = true): Promise<DuckDBConnection> => {
|
||||||
|
|
||||||
// Configure DuckDB for optimal performance with large datasets
|
// Configure DuckDB for optimal performance with large datasets
|
||||||
if (useDisk) {
|
if (useDisk) {
|
||||||
conn.exec("SET memory_limit='2GB';", (err) => {
|
conn.exec("SET memory_limit='2GB';", (err: Error | null) => {
|
||||||
if (err) console.warn('Failed to set memory limit:', err);
|
if (err) console.warn('Failed to set memory limit:', err);
|
||||||
});
|
});
|
||||||
conn.exec('SET threads=4;', (err) => {
|
conn.exec('SET threads=4;', (err: Error | null) => {
|
||||||
if (err) console.warn('Failed to set thread count:', err);
|
if (err) console.warn('Failed to set thread count:', err);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -138,7 +138,7 @@ export const closeConnection = (connection: DuckDBConnection): Promise<void> =>
|
||||||
*/
|
*/
|
||||||
export const executeQuery = <T = unknown>(conn: duckdb.Connection, sql: string): Promise<T[]> => {
|
export const executeQuery = <T = unknown>(conn: duckdb.Connection, sql: string): Promise<T[]> => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
conn.all(sql, (err, result) => {
|
conn.all(sql, (err: Error | null, result: unknown) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
reject(new Error(`DuckDB query failed: ${err.message}\nSQL: ${sql}`));
|
reject(new Error(`DuckDB query failed: ${err.message}\nSQL: ${sql}`));
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue