|
81 | 81 | }) |
82 | 82 | ); |
83 | 83 |
|
84 | | -// Create index command |
85 | | -$application->add((new Command('create-index')) |
| 84 | +// Add column command |
| 85 | +$application->add((new Command('add-column')) |
86 | 86 | ->setDefinition($inputDefinition) |
87 | | - ->setDescription('Adds a simple index to the example database.') |
| 87 | + ->setDescription('Adds a new column to the Albums table in the example database.') |
88 | 88 | ->setCode(function ($input, $output) { |
89 | | - create_index( |
| 89 | + add_column( |
90 | 90 | $input->getArgument('instance_id'), |
91 | 91 | $input->getArgument('database_id') |
92 | 92 | ); |
93 | 93 | }) |
94 | 94 | ); |
95 | 95 |
|
96 | | -// Query data with index command |
97 | | -$application->add((new Command('query-data-with-index')) |
98 | | - ->setDefinition(clone $inputDefinition) |
99 | | - ->addOption('start_title', null, InputOption::VALUE_REQUIRED, 'The start of the title index.', 'Aardvark') |
100 | | - ->addOption('end_title', null, InputOption::VALUE_REQUIRED, 'The end of the title index.', 'Goo') |
101 | | - ->setDescription('Queries sample data from the database using SQL and an index.') |
| 96 | +// Update data command |
| 97 | +$application->add((new Command('update-data')) |
| 98 | + ->setDefinition($inputDefinition) |
| 99 | + ->setDescription('Updates sample data in the database.') |
102 | 100 | ->setCode(function ($input, $output) { |
103 | | - query_data_with_index( |
| 101 | + update_data( |
104 | 102 | $input->getArgument('instance_id'), |
105 | | - $input->getArgument('database_id'), |
106 | | - $input->getOption('start_title'), |
107 | | - $input->getOption('end_title') |
| 103 | + $input->getArgument('database_id') |
108 | 104 | ); |
109 | 105 | }) |
110 | 106 | ); |
111 | 107 |
|
112 | | -// Read data with index command |
113 | | -$application->add((new Command('read-data-with-index')) |
| 108 | +// Query data with new column command |
| 109 | +$application->add((new Command('query-data-with-new-column')) |
114 | 110 | ->setDefinition($inputDefinition) |
115 | | - ->setDescription('Reads sample data from the database using an index.') |
| 111 | + ->setDescription('Queries sample data from the database using SQL.') |
116 | 112 | ->setCode(function ($input, $output) { |
117 | | - read_data_with_index( |
| 113 | + query_data_with_new_column( |
118 | 114 | $input->getArgument('instance_id'), |
119 | 115 | $input->getArgument('database_id') |
120 | 116 | ); |
121 | 117 | }) |
122 | 118 | ); |
123 | 119 |
|
124 | | -// Create storing index command |
125 | | -$application->add((new Command('create-storing-index')) |
| 120 | +// Read-write transaction command |
| 121 | +$application->add((new Command('read-write-transaction')) |
126 | 122 | ->setDefinition($inputDefinition) |
127 | | - ->setDescription('Adds an storing index to the example database.') |
| 123 | + ->setDescription('Performs a read-write transaction to update two sample records in the database.') |
128 | 124 | ->setCode(function ($input, $output) { |
129 | | - create_storing_index( |
| 125 | + read_write_transaction( |
130 | 126 | $input->getArgument('instance_id'), |
131 | 127 | $input->getArgument('database_id') |
132 | 128 | ); |
133 | 129 | }) |
134 | 130 | ); |
135 | 131 |
|
136 | | -// Read data with storing index command |
137 | | -$application->add((new Command('read-data-with-storing-index')) |
| 132 | +// Create index command |
| 133 | +$application->add((new Command('create-index')) |
138 | 134 | ->setDefinition($inputDefinition) |
139 | | - ->setDescription('Reads sample data from the database using an index with a storing clause.') |
| 135 | + ->setDescription('Adds a simple index to the example database.') |
140 | 136 | ->setCode(function ($input, $output) { |
141 | | - read_data_with_storing_index( |
| 137 | + create_index( |
142 | 138 | $input->getArgument('instance_id'), |
143 | 139 | $input->getArgument('database_id') |
144 | 140 | ); |
145 | 141 | }) |
146 | 142 | ); |
147 | 143 |
|
148 | | -// Add column command |
149 | | -$application->add((new Command('add-column')) |
150 | | - ->setDefinition($inputDefinition) |
151 | | - ->setDescription('Adds a new column to the Albums table in the example database.') |
| 144 | +// Query data with index command |
| 145 | +$application->add((new Command('query-data-with-index')) |
| 146 | + ->setDefinition(clone $inputDefinition) |
| 147 | + ->addOption('start_title', null, InputOption::VALUE_REQUIRED, 'The start of the title index.', 'Aardvark') |
| 148 | + ->addOption('end_title', null, InputOption::VALUE_REQUIRED, 'The end of the title index.', 'Goo') |
| 149 | + ->setDescription('Queries sample data from the database using SQL and an index.') |
152 | 150 | ->setCode(function ($input, $output) { |
153 | | - add_column( |
| 151 | + query_data_with_index( |
154 | 152 | $input->getArgument('instance_id'), |
155 | | - $input->getArgument('database_id') |
| 153 | + $input->getArgument('database_id'), |
| 154 | + $input->getOption('start_title'), |
| 155 | + $input->getOption('end_title') |
156 | 156 | ); |
157 | 157 | }) |
158 | 158 | ); |
159 | 159 |
|
160 | | -// Query data with new column command |
161 | | -$application->add((new Command('query-data-with-new-column')) |
| 160 | +// Read data with index command |
| 161 | +$application->add((new Command('read-data-with-index')) |
162 | 162 | ->setDefinition($inputDefinition) |
163 | | - ->setDescription('Queries sample data from the database using SQL.') |
| 163 | + ->setDescription('Reads sample data from the database using an index.') |
164 | 164 | ->setCode(function ($input, $output) { |
165 | | - query_data_with_new_column( |
| 165 | + read_data_with_index( |
166 | 166 | $input->getArgument('instance_id'), |
167 | 167 | $input->getArgument('database_id') |
168 | 168 | ); |
169 | 169 | }) |
170 | 170 | ); |
171 | 171 |
|
172 | | -// Update data command |
173 | | -$application->add((new Command('update-data')) |
| 172 | +// Create storing index command |
| 173 | +$application->add((new Command('create-storing-index')) |
174 | 174 | ->setDefinition($inputDefinition) |
175 | | - ->setDescription('Updates sample data in the database.') |
| 175 | + ->setDescription('Adds an storing index to the example database.') |
176 | 176 | ->setCode(function ($input, $output) { |
177 | | - update_data( |
| 177 | + create_storing_index( |
178 | 178 | $input->getArgument('instance_id'), |
179 | 179 | $input->getArgument('database_id') |
180 | 180 | ); |
181 | 181 | }) |
182 | 182 | ); |
183 | 183 |
|
184 | | -// Read-write transaction command |
185 | | -$application->add((new Command('read-write-transaction')) |
| 184 | +// Read data with storing index command |
| 185 | +$application->add((new Command('read-data-with-storing-index')) |
186 | 186 | ->setDefinition($inputDefinition) |
187 | | - ->setDescription('Performs a read-write transaction to update two sample records in the database.') |
| 187 | + ->setDescription('Reads sample data from the database using an index with a storing clause.') |
188 | 188 | ->setCode(function ($input, $output) { |
189 | | - read_write_transaction( |
| 189 | + read_data_with_storing_index( |
190 | 190 | $input->getArgument('instance_id'), |
191 | 191 | $input->getArgument('database_id') |
192 | 192 | ); |
|
0 commit comments