Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
sonots committed Feb 11, 2015
1 parent 6d1530e commit 90c1f66
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# ruby-sql-maker

[![Build Status](https://secure.travis-ci.org/sonots/ruby-sql-maker.png?branch=master)](http://travis-ci.org/sonots/ruby-sql-maker)
[![Coverage Status](https://coveralls.io/repos/sonots/ruby-sql-maker/badge.png?branch=master)](https://coveralls.io/r/sonots/ruby-sql-maker?branch=master)

SQL Builder for Ruby

@@ -38,6 +37,13 @@ builder.add_select(sql_raw('COUNT(*)')).add_from('books').as_sql
# => SELECT COUNT(*) FROM "books"
```

You may want to use quoting or SQL escape function together with `sql_raw`.

```ruby
SQL::Maker::Quoting.quote("gi'thubber's") #=> 'gi''thubber''s'
SQL::Maker::Quoting.escape("gi'thubber's") #=> gi''thubber''s
```

## Further Reading

Please see the [doc](./doc) directory.
@@ -80,14 +86,6 @@ See following articles for more details (perl version)
* http://blog.kazuhooku.com/2014/07/the-json-sql-injection-vulnerability.html (English)
* http://developers.mobage.jp/blog/2014/7/3/jsonsql-injection (Japanese)

## SQL Escape

SQL Maker automatically does escape, but when you want to do it manually by some reasons, call

```
SQL::Maker::Quoting.quote(string)
```

## See Also

* [perl の SQL::Maker (と SQL::QueryMaker) を ruby に移植した - sonots:blog](http://blog.livedoor.jp/sonots/archives/38723820.html) (Japanese)

0 comments on commit 90c1f66

Please sign in to comment.