cryesql

Version, currently master branch1 version
  • master branchlatestMar 31, 2016

github.com/spalladino/cryesql

Port of yesql to Crystal

1 stars
0 dependents
License: MIT

Installation

# Add this to your shard.yml
dependencies:
  cryesql:
    github: spalladino/cryesql
    branch: master

master is a branch, not a release, so this tracks it rather than pinning a version.

Then run:

shards install

shard.yml

Crystal
no constraint declared
License
MIT
Author
Santiago Palladino

Dependencies

Runtime Dependencies

  • db*github: bcardiff/crystal-db

Development Dependencies

  • sqlite3*github: bcardiff/crystal-sqlite3, branch: dbdev

README

cryesql

Build Status

Port of Clojure yesql to Crystal.

Work in progress

Usage

Automatically create methods for queries defined in a .sql file with magic comments via the def_queries macro.

Given the file users.sql:

-- name: select_users
SELECT * FROM users

Invoke def_queries("users.sql", db), where db is a reference to a valid DB object, to autogenerate a method named select_users that will run the SELECT * FROM users query on the db object and return the result.

Installation

Add this to your application's shard.yml:

dependencies:
  cryesql:
    github: spalladino/cryesql

Contributors