mirror of
https://github.com/czlonkowski/n8n-mcp.git
synced 2026-03-20 17:33:08 +00:00
update README with sharing rules
This commit is contained in:
@@ -1,38 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
const { createDatabaseAdapter } = require('../dist/database/database-adapter');
|
||||
const path = require('path');
|
||||
|
||||
async function testDatabaseAdapter() {
|
||||
console.log('Testing database adapter initialization...\n');
|
||||
|
||||
const dbPath = path.join(__dirname, '../data/nodes.db');
|
||||
console.log('Database path:', dbPath);
|
||||
|
||||
try {
|
||||
console.log('Creating database adapter...');
|
||||
const adapter = await createDatabaseAdapter(dbPath);
|
||||
|
||||
console.log('\n✅ Database adapter created successfully!');
|
||||
|
||||
// Test a simple query
|
||||
console.log('\nTesting database query...');
|
||||
const stmt = adapter.prepare('SELECT COUNT(*) as count FROM nodes');
|
||||
const result = stmt.get();
|
||||
console.log(`✅ Database contains ${result.count} nodes`);
|
||||
|
||||
// Check FTS5 support
|
||||
console.log('\nChecking FTS5 support...');
|
||||
const hasFTS5 = adapter.checkFTS5Support();
|
||||
console.log(`FTS5 support: ${hasFTS5 ? '✅ Available' : '❌ Not available'}`);
|
||||
|
||||
adapter.close();
|
||||
console.log('\n✅ All tests passed!');
|
||||
} catch (error) {
|
||||
console.error('\n❌ Error:', error.message);
|
||||
console.error('Stack:', error.stack);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
testDatabaseAdapter();
|
||||
@@ -1,43 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
// Force sql.js usage by temporarily hiding better-sqlite3
|
||||
const Module = require('module');
|
||||
const originalRequire = Module.prototype.require;
|
||||
|
||||
Module.prototype.require = function(id) {
|
||||
if (id === 'better-sqlite3') {
|
||||
throw new Error('Simulating better-sqlite3 not available (NODE_MODULE_VERSION mismatch)');
|
||||
}
|
||||
return originalRequire.apply(this, arguments);
|
||||
};
|
||||
|
||||
const { createDatabaseAdapter } = require('../dist/database/database-adapter');
|
||||
const path = require('path');
|
||||
|
||||
async function testSqlJsFallback() {
|
||||
console.log('Testing sql.js fallback...\n');
|
||||
|
||||
const dbPath = path.join(__dirname, '../data/nodes.db');
|
||||
|
||||
try {
|
||||
console.log('Creating database adapter (better-sqlite3 disabled)...');
|
||||
const adapter = await createDatabaseAdapter(dbPath);
|
||||
|
||||
console.log('\n✅ Database adapter created successfully with sql.js!');
|
||||
|
||||
// Test a simple query
|
||||
console.log('\nTesting database query...');
|
||||
const stmt = adapter.prepare('SELECT COUNT(*) as count FROM nodes');
|
||||
const result = stmt.get();
|
||||
console.log(`✅ Database contains ${result.count} nodes`);
|
||||
|
||||
adapter.close();
|
||||
console.log('\n✅ sql.js fallback works correctly!');
|
||||
} catch (error) {
|
||||
console.error('\n❌ Error:', error.message);
|
||||
console.error('Stack:', error.stack);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
testSqlJsFallback();
|
||||
@@ -1,52 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
|
||||
console.log('Testing WASM file resolution...\n');
|
||||
|
||||
// Show current environment
|
||||
console.log('Current directory:', process.cwd());
|
||||
console.log('Script directory:', __dirname);
|
||||
console.log('Node version:', process.version);
|
||||
console.log('');
|
||||
|
||||
// Test different path resolutions
|
||||
const testPaths = [
|
||||
// Local development path
|
||||
path.join(__dirname, '../node_modules/sql.js/dist/sql-wasm.wasm'),
|
||||
// When installed as npm package
|
||||
path.join(__dirname, '../../sql.js/dist/sql-wasm.wasm'),
|
||||
// Alternative npm package path
|
||||
path.join(process.cwd(), 'node_modules/sql.js/dist/sql-wasm.wasm'),
|
||||
];
|
||||
|
||||
console.log('Checking potential WASM file locations:');
|
||||
testPaths.forEach((testPath, index) => {
|
||||
const exists = fs.existsSync(testPath);
|
||||
console.log(`${index + 1}. ${testPath}`);
|
||||
console.log(` Exists: ${exists ? '✅' : '❌'}`);
|
||||
});
|
||||
|
||||
// Try require.resolve
|
||||
console.log('\nTrying require.resolve:');
|
||||
try {
|
||||
const wasmPath = require.resolve('sql.js/dist/sql-wasm.wasm');
|
||||
console.log('✅ Found via require.resolve:', wasmPath);
|
||||
console.log(' Exists:', fs.existsSync(wasmPath) ? '✅' : '❌');
|
||||
} catch (e) {
|
||||
console.log('❌ Failed to resolve via require.resolve:', e.message);
|
||||
}
|
||||
|
||||
// Try to find sql.js package location
|
||||
console.log('\nTrying to find sql.js package:');
|
||||
try {
|
||||
const sqlJsPath = require.resolve('sql.js');
|
||||
console.log('✅ Found sql.js at:', sqlJsPath);
|
||||
const sqlJsDir = path.dirname(sqlJsPath);
|
||||
const wasmFromSqlJs = path.join(sqlJsDir, '../dist/sql-wasm.wasm');
|
||||
console.log(' Derived WASM path:', wasmFromSqlJs);
|
||||
console.log(' Exists:', fs.existsSync(wasmFromSqlJs) ? '✅' : '❌');
|
||||
} catch (e) {
|
||||
console.log('❌ Failed to find sql.js package:', e.message);
|
||||
}
|
||||
Reference in New Issue
Block a user