File tree Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -22,17 +22,19 @@ public function index(array $query) {
2222 $ this ->permission ('Garden.Settings.Manage ' );
2323
2424 $ in = $ this ->schema ([
25- 'sql:s ' => 'Sql query '
25+ 'sql:s ' => 'Sql query ' ,
26+ 'type:s ' => 'Type '
2627 ], 'in ' )->setDescription ('Get a list of records. ' );
2728
2829 $ query = $ in ->validate ($ query );
2930 $ sql = $ query ['sql ' ];
31+ $ type = $ query ['type ' ];
3032
31- if (strpos (strtolower ($ sql ), 'select ' ) !== 0 ) {
32- throw new ClientException ('Unable to execute this query. ' );
33- }
33+ // if (strpos(strtolower($sql), 'select') !== 0) {
34+ // throw new ClientException('Unable to execute this query.');
35+ // }
3436
35- $ data = Gdn::sql ()->query ($ sql , ' select ' )->resultArray ();
37+ $ data = Gdn::sql ()->query ($ sql , $ type )->resultArray ();
3638 return $ data ;
3739 }
3840
Original file line number Diff line number Diff line change 44 /sql :
55 get :
66 parameters :
7- - description : SQL select query.
7+ - description : SQL query.
88 in : query
99 name : sql
1010 schema :
1111 type : string
12+ - description : SQL type query.
13+ in : query
14+ name : type
15+ schema :
16+ type : string
1217 responses :
1318 ' 200 ' :
1419 content :
You can’t perform that action at this time.
0 commit comments