This commit is contained in:
seb
2026-07-31 00:22:36 +02:00
parent af8ef0a788
commit a47c598f76
2 changed files with 2 additions and 5 deletions

View File

@@ -66,7 +66,7 @@ const METHODS = [
{ value: 'google_auth.add', label: 'google_auth.add', hint: 'email → authId' },
{ value: 'google_auth.list', label: 'google_auth.list', hint: '→ rows' },
{ value: 'google_auth.del', label: 'google_auth.del', hint: 'id' },
{ value: 'initialize', label: 'initialize', hint: 'purge + recreate' },
{ value: 'initialize', label: 'initialize', hint: 'ensure schema (no purge)' },
{ value: 'purge', label: chalk.red('purge'), hint: 'drop all · exit' },
{ value: 'exit', label: 'exit', hint: 'quit without purge' },
];
@@ -220,7 +220,7 @@ async function main() {
p.note(
[
chalk.dim(`${config.server} / ${config.database}`),
chalk.dim('purge ends the session'),
chalk.dim('initialize = ensure schema · purge ends session'),
].join('\n'),
'Connected',
);

View File

@@ -1,10 +1,7 @@
import { SCHEMA_SCRIPTS } from '../schema.js';
import purge from './purge.js';
export default function initialize(pool) {
const doPurge = purge(pool);
return async () => {
await doPurge();
for (const script of SCHEMA_SCRIPTS) {
await pool.request().query(script);
}