Skip to content

Commit ad246f5

Browse files
committed
simple test file while i add capabilities
1 parent f61aa25 commit ad246f5

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

x.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
ini_set('display_errors', 1);
3+
error_reporting(E_ERROR | E_WARNING | E_PARSE);
4+
5+
include('lib_sql_parser.php');
6+
7+
$sql = <<<EOD
8+
CREATE TABLE `mentions` (
9+
`team_id` bigint(20) unsigned NOT NULL,
10+
`type` enum('at','word','dm','everyone','channel','everything') NOT NULL,
11+
`is_bot` tinyint(3) unsigned NOT NULL,
12+
PRIMARY KEY (`team_id`),
13+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
14+
15+
EOD;
16+
17+
$obj = new SQLParser();
18+
19+
#$tokens = $obj->lex($sql);
20+
#print_r($tokens);
21+
#exit;
22+
23+
$obj->parse($sql);
24+
#echo json_encode($obj->tables['bounces']['fields'], JSON_PRETTY_PRINT)."\n";
25+
echo json_encode($obj->tables, JSON_PRETTY_PRINT)."\n";
26+

0 commit comments

Comments
 (0)