Skip to content

Conversation

@staabm
Copy link
Contributor

@staabm staabm commented Apr 5, 2019

this change implements reading from stdin, so the command can be used in a unix-pipe style:

tools/sql-parser$ echo "SELECT 1" | php bin/highlight-query
SELECT
    1

tools/sql-parser$ echo "SELECT 1" | php bin/lint-query
tools/sql-parser$ echo $?
0

tools/sql-parser$ echo "abc" | php bin/lint-query
#1: Unexpected beginning of statement. (near "abc" at position 0)
tools/sql-parser$ echo $?
10

tools/sql-parser$ echo "SELECT 1" | php bin/tokenize-query
[TOKEN 0]
Type = 1
Flags = 3
Value = 'SELECT'
Token = 'SELECT'

[TOKEN 1]
Type = 3
Flags = 0
Value = ' '
Token = ' '

[TOKEN 2]
Type = 6
Flags = 0
Value = 1
Token = '1'

[TOKEN 3]
Type = 3
Flags = 0
Value = ' '
Token = '
'

[TOKEN 4]
Type = 9
Flags = 0
Value = NULL
Token = NULL

refs #237

@codecov
Copy link

codecov bot commented Apr 5, 2019

Codecov Report

Merging #239 into master will decrease coverage by 0.07%.
The diff coverage is 78.57%.

@@             Coverage Diff              @@
##             master     #239      +/-   ##
============================================
- Coverage      99.7%   99.63%   -0.08%     
- Complexity     1842     1849       +7     
============================================
  Files            61       61              
  Lines          4104     4118      +14     
============================================
+ Hits           4092     4103      +11     
- Misses           12       15       +3

@devenbansod devenbansod self-requested a review April 5, 2019 14:31
@ibennetch ibennetch merged commit 975a0b8 into phpmyadmin:master Apr 7, 2019
@ibennetch ibennetch self-assigned this Apr 7, 2019
ibennetch added a commit that referenced this pull request Apr 7, 2019
…oduced with #239

Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants