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) {
22
22
$ this ->permission ('Garden.Settings.Manage ' );
23
23
24
24
$ in = $ this ->schema ([
25
- 'sql:s ' => 'Sql query '
25
+ 'sql:s ' => 'Sql query ' ,
26
+ 'type:s ' => 'Type '
26
27
], 'in ' )->setDescription ('Get a list of records. ' );
27
28
28
29
$ query = $ in ->validate ($ query );
29
30
$ sql = $ query ['sql ' ];
31
+ $ type = $ query ['type ' ];
30
32
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
+ // }
34
36
35
- $ data = Gdn::sql ()->query ($ sql , ' select ' )->resultArray ();
37
+ $ data = Gdn::sql ()->query ($ sql , $ type )->resultArray ();
36
38
return $ data ;
37
39
}
38
40
Original file line number Diff line number Diff line change 4
4
/sql :
5
5
get :
6
6
parameters :
7
- - description : SQL select query.
7
+ - description : SQL query.
8
8
in : query
9
9
name : sql
10
10
schema :
11
11
type : string
12
+ - description : SQL type query.
13
+ in : query
14
+ name : type
15
+ schema :
16
+ type : string
12
17
responses :
13
18
' 200 ' :
14
19
content :
You can’t perform that action at this time.
0 commit comments