u
This commit is contained in:
@@ -66,7 +66,7 @@ const METHODS = [
|
|||||||
{ value: 'google_auth.add', label: 'google_auth.add', hint: 'email → authId' },
|
{ value: 'google_auth.add', label: 'google_auth.add', hint: 'email → authId' },
|
||||||
{ value: 'google_auth.list', label: 'google_auth.list', hint: '→ rows' },
|
{ value: 'google_auth.list', label: 'google_auth.list', hint: '→ rows' },
|
||||||
{ value: 'google_auth.del', label: 'google_auth.del', hint: 'id' },
|
{ 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: 'purge', label: chalk.red('purge'), hint: 'drop all · exit' },
|
||||||
{ value: 'exit', label: 'exit', hint: 'quit without purge' },
|
{ value: 'exit', label: 'exit', hint: 'quit without purge' },
|
||||||
];
|
];
|
||||||
@@ -220,7 +220,7 @@ async function main() {
|
|||||||
p.note(
|
p.note(
|
||||||
[
|
[
|
||||||
chalk.dim(`${config.server} / ${config.database}`),
|
chalk.dim(`${config.server} / ${config.database}`),
|
||||||
chalk.dim('purge ends the session'),
|
chalk.dim('initialize = ensure schema · purge ends session'),
|
||||||
].join('\n'),
|
].join('\n'),
|
||||||
'Connected',
|
'Connected',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,10 +1,7 @@
|
|||||||
import { SCHEMA_SCRIPTS } from '../schema.js';
|
import { SCHEMA_SCRIPTS } from '../schema.js';
|
||||||
import purge from './purge.js';
|
|
||||||
|
|
||||||
export default function initialize(pool) {
|
export default function initialize(pool) {
|
||||||
const doPurge = purge(pool);
|
|
||||||
return async () => {
|
return async () => {
|
||||||
await doPurge();
|
|
||||||
for (const script of SCHEMA_SCRIPTS) {
|
for (const script of SCHEMA_SCRIPTS) {
|
||||||
await pool.request().query(script);
|
await pool.request().query(script);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user