Skip to content

Commit

Permalink
Merge pull request #13 from sonota88/devel_v0.1.0
Browse files Browse the repository at this point in the history
v0.1.0
  • Loading branch information
sonota88 authored Jan 22, 2019
2 parents 2b83de5 + cf9e849 commit 9233304
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 6 deletions.
27 changes: 26 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,33 @@
# 0.1.0 (2018-12-16)

## Breaking changes

- Support `"{schema}"."{table}"` notation.
- Tokenize as a single name token. This affects formatter output:

```
echo 'select a from b.c, "d"."e"' | bin/anbt-sql-formatter
(before)
SELECT
a
FROM
b.c
,"d" . "e"
(after)
SELECT
a
FROM
b.c
,"d"."e"
```

# 0.0.7 (2018-08-11)

No breaking changes.

## Feattues
## Features

- New configuration parameter `Rule#in_values_num`
for controlling number of values in IN clause per line.
Expand Down
4 changes: 2 additions & 2 deletions readme.ja.txt → README.ja.rdoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
= anbt-sql-formatter

(C) 2010 sonota <[email protected]>
(C) 2010-2018 sonota88 <[email protected]>


== 概要
Expand Down Expand Up @@ -95,7 +95,7 @@ sonota:: Ruby へ移植

== テスト

$ ruby setup.rb test
$ ./test.sh


== その他
Expand Down
4 changes: 2 additions & 2 deletions readme.txt → README.rdoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
= anbt-sql-formatter

(C) 2010 sonota ([email protected])
(C) 2010-2018 sonota88 ([email protected])


== Description
Expand Down Expand Up @@ -55,4 +55,4 @@ Following are Authors of BlancoSqlFormatter(original Java version).

== Test

$ ruby setup.rb test
$ ./test.sh
2 changes: 1 addition & 1 deletion lib/anbt-sql-formatter/version.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Anbt
module Sql
module Formatter
VERSION = "0.0.7"
VERSION = "0.1.0"
end
end
end
4 changes: 4 additions & 0 deletions sample.sql
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,7 @@ foobar(a)
foobar(a,b)
;

--------------------------------
-- {schema}.{table}, {table}.{column}
select t1.a, `t2`.`b`, "t3"."c"
from schema.t1, `schema`.`t2`, "schema"."t3"
10 changes: 10 additions & 0 deletions test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

set -o errexit

(
cd test
for file in $(ls test_*.rb); do
ruby $file
done
)
15 changes: 15 additions & 0 deletions test/test_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,21 @@ def test_parser
)))
)

########
assert_equals(
msg + "double-quoted schema and table",
strip_indent(
<<-EOB
name ("admin"."test")
EOB
),
_format( @parser.parse( strip_indent(
<<-EOB
"admin"."test"
EOB
)))
)

########
assert_equals(
msg + "minus + non-number",
Expand Down

0 comments on commit 9233304

Please sign in to comment.