sql
Version, currently main branch1 version
- main branchlatestSep 5, 2024
github.com/jwoertink/sql
A Crystal SQL builder
3 stars
0 dependents
License: MIT
Installation
# Add this to your shard.yml
dependencies:
sql:
github: jwoertink/sql
branch: mainmain is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
>= 1.12.1- License
- MIT
- Author
- Jeremy Woertink
Dependencies
Development Dependencies
- ameba~> 1.5.0github: crystal-ameba/amebadev
README
SQL
This is intended to be a very low level SQL builder. It should be fairly agnostic to the engine being used. It's not inteded to run the SQL, but just turn Crystal code in to a giant SQL string for use under the hood of an ORM, or just general type-safety.
⚠️ this is mainly experimental and the API may change ⚠️
Installation
-
Add the dependency to your
shard.yml:dependencies: sql: github: jwoertink/sql -
Run
shards install
Usage
require "sql"
# NOTE: This is all experimental playground and this may change
builder = SQL.builder
select_statement = SQL_Select.new
select_statement.write("name")
from_statement = SQL_From.new
from_statement.write("people")
builder.add(select_statement)
builder.add(from_statement)
builder.build
puts builder.to_s #=> SELECT name FROM people
Development
- Write spec
crystal tool format spec/ src/./bin/ameba- Repeat
Contributing
- Fork it (https://github.com/jwoertink/sql/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
- Jeremy Woertink - creator and maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
main- Seen
- Sep 5, 2024
- Crystal
>= 1.12.1- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/jwoertink/sql
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 14, 2026
- Synced
- Aug 14, 2026
- Versions
- 1