cr-corm
Corm
SQL Statement Builder (currently supporting PostgreSQL)
Installation
Add this to your application's shard.yml
:
dependencies:
corm:
github: gdotdesign/corm
Features
TODO: Finalize feature list
Statements:
- SELECT
- INNER_JOIN
- GROUP BY
- WHERE
- INSERT
- CREATE
- DELETE
- OUTER_JOIN
- LIMIT
- ORDER BY
- ALTER TABLE
- CREATE TABLE
Functions:
- MAX
- MIN
- COUNT
- SUM
- AVG
- ROUND
- DISTINCT
Helpers:
- .columns
Usage
TODO: Write more useful documentation
require "corm"
# Simple query without type casting
Corm.table("users")
.select("id", "name")
.where({ "id" => 23 })
.one
# [[23 : PG::PGValue, "Some User" : PG::PGValue ]]
# Simple query with type casting
Corm.table("users")
.select("id", "name")
.where({ "id" => 23 })
.one({Int32, String})
# {23 : Int32, "Some User" : String}
Development
There is no special development dependencies other then PostgreSQL so far.
Contributing
- Fork it ( https://github.com/gdotdesign/corm/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
Contributors
- gdotdesign Szikszai Gusztáv - creator, maintainer
Repository
cr-corm
Owner
Statistic
- 5
- 0
- 0
- 0
- 2
- almost 7 years ago
- July 13, 2016
License
MIT License
Links
Synced at
Thu, 21 Nov 2024 20:17:04 GMT
Languages