'use strict'; const mysql = require('mysql2/promise'); (async () => { const c = await mysql.createConnection({ host: '127.0.0.1', port: 3307, user: 'wms', password: 'dspxmRwRdRbWtbm7', database: 'wms' }); const [p] = await c.query("SELECT id, path, meta_title FROM wms_permission WHERE path LIKE 'storage.inventory%' AND type='api'"); console.log('perms:', JSON.stringify(p)); const [r] = await c.query('SELECT id, permissions FROM wms_role WHERE id IN (7)'); console.log('roles:', JSON.stringify(r)); const [col] = await c.query('SHOW COLUMNS FROM wms_role'); console.log('cols:', col.map(x => x.Field + ':' + x.Type).join(', ')); await c.end(); })().catch(e => { console.error(e); process.exit(1); });