README.md in sql_query-0.2.1 vs README.md in sql_query-0.3.0
- old
+ new
@@ -95,9 +95,35 @@
# config/initializers/sql_query.rb
SqlQuery.configure do |config|
config.path = '/app/sql_templates'
end
```
+### Partials
+
+You can prepare part of sql query in partial file and reuse it in multiple queries.
+
+Partial file should start with '_'.
+
+Example:
+
+```sql
+# app/sql_queries/_email_partial.sql.erb
+players.email = <%= quote @email %>
+```
+
+and use this partial like this:
+
+```sql
+SELECT *
+FROM players
+WHERE <%= partial :email_partial %>
+```
+
+## Examples
+
+Check examples folder for some usefull queries.
+
+If you have some examples to share please make pull request.
## Contributing
1. Fork it ( https://github.com/[my-github-username]/sql_query/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)