const sqlite3 = require('sqlite3').verbose(); const path = require('path'); // 使用正确的数据库路径 const dbPath = path.join(__dirname, 'data/cashier.db'); console.log('Database path:', dbPath); const db = new sqlite3.Database(dbPath); db.serialize(() => { db.all("PRAGMA table_info(order_items)", (err, rows) => { if (err) { console.error('Error:', err); } else { console.log('order_items table structure:'); rows.forEach(row => { console.log(`Column: ${row.name}, Type: ${row.type}, Not Null: ${row.notnull}, Default: ${row.dflt_value}, Primary Key: ${row.pk}`); }); } db.close(); }); });