docs: add work log for 2026-06-15 and update DB deletion policy in README
This commit is contained in:
24
scratch/check_codes.cjs
Normal file
24
scratch/check_codes.cjs
Normal file
@@ -0,0 +1,24 @@
|
||||
const mysql = require('mysql2/promise');
|
||||
require('dotenv').config();
|
||||
|
||||
async function checkCodes() {
|
||||
const connection = await mysql.createConnection({
|
||||
host: process.env.DB_HOST,
|
||||
user: process.env.DB_USER,
|
||||
password: process.env.DB_PASS,
|
||||
database: process.env.DB_NAME,
|
||||
port: parseInt(process.env.DB_PORT || '3306')
|
||||
});
|
||||
|
||||
console.log('--- Asset Codes Sample ---');
|
||||
const [rows] = await connection.query('SELECT id, asset_code, purchase_date FROM asset_core WHERE id LIKE "PC_20260615_%" LIMIT 10');
|
||||
console.log(rows);
|
||||
|
||||
console.log('\n--- Other Asset Codes Sample ---');
|
||||
const [rows2] = await connection.query('SELECT id, asset_code, purchase_date FROM asset_core WHERE id NOT LIKE "PC_20260615_%" AND asset_code IS NOT NULL LIMIT 5');
|
||||
console.log(rows2);
|
||||
|
||||
await connection.end();
|
||||
}
|
||||
|
||||
checkCodes().catch(console.error);
|
||||
Reference in New Issue
Block a user