1 | import { BaseCommand } from '@adonisjs/core/build/standalone';
|
2 | export default class DbSeed extends BaseCommand {
|
3 | static commandName: string;
|
4 | static description: string;
|
5 | static settings: {
|
6 | loadApp: boolean;
|
7 | };
|
8 | private seeder;
|
9 | /**
|
10 | * Track if one or more seeders have failed
|
11 | */
|
12 | private hasError;
|
13 | /**
|
14 | * Choose a custom pre-defined connection. Otherwise, we use the
|
15 | * default connection
|
16 | */
|
17 | connection: string;
|
18 | /**
|
19 | * Interactive mode allows selecting seeder files
|
20 | */
|
21 | interactive: boolean;
|
22 | /**
|
23 | * Define a custom set of seeder files. Interactive and files together ignores
|
24 | * the interactive mode.
|
25 | */
|
26 | files: string[];
|
27 | /**
|
28 | * Display migrations result in one compact single-line output
|
29 | */
|
30 | compactOutput: boolean;
|
31 | /**
|
32 | * Print log message to the console
|
33 | */
|
34 | private printLogMessage;
|
35 | /**
|
36 | * Not a valid connection
|
37 | */
|
38 | private printNotAValidConnection;
|
39 | /**
|
40 | * Print log that the selected seeder file is invalid
|
41 | */
|
42 | private printNotAValidFile;
|
43 | /**
|
44 | * Get files cherry picked using either "--interactive" or the
|
45 | * "--files" flag
|
46 | */
|
47 | private getCherryPickedFiles;
|
48 | /**
|
49 | * Instantiate seeders runner
|
50 | */
|
51 | private instantiateSeeder;
|
52 | /**
|
53 | * Execute selected seeders
|
54 | */
|
55 | private executedSeeders;
|
56 | /**
|
57 | * Print Single-line output when `compact-output` is enabled
|
58 | */
|
59 | private logCompactFinalStatus;
|
60 | /**
|
61 | * Run as a subcommand. Never close database connection or exit
|
62 | * process here
|
63 | */
|
64 | private runAsSubCommand;
|
65 | /**
|
66 | * Branching out, so that if required we can implement
|
67 | * "runAsMain" separately from "runAsSubCommand".
|
68 | *
|
69 | * For now, they both are the same
|
70 | */
|
71 | private runAsMain;
|
72 | /**
|
73 | * Handle command
|
74 | */
|
75 | run(): Promise<void>;
|
76 | /**
|
77 | * Lifecycle method invoked by ace after the "run"
|
78 | * method.
|
79 | */
|
80 | completed(): Promise<void>;
|
81 | }
|