Discovers existing records with additional columns for multi-key mapping support.
Scans a table to find primary keys along with username, email, and name columns
when they exist, allowing these additional columns to be used as lookup keys.
Promise resolving to array of record data with available columns
Throws
If table doesn't exist or database query fails
Example
// Discover all user records with available lookup columns constrecords = awaitdiscoverExistingRecordsWithColumns(env.DB_EXISTING, 'users'); console.log(`Found ${records.length} user records`); records.forEach(record=> { console.log(`ID: ${record.id}, Email: ${record.email||'N/A'}`); });
Discovers existing records with additional columns for multi-key mapping support. Scans a table to find primary keys along with username, email, and name columns when they exist, allowing these additional columns to be used as lookup keys.