• Stars
    star
    58
  • Rank 516,103 (Top 11 %)
  • Language
    Erlang
  • License
    MIT License
  • Created over 12 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An Erlang-flavoured SQL DSL

Sqerl

Sqerl is a domain specific embedded language for expressing SQL statements in Erlang as well as a library for generating the literal equivalents of Sqerl expressions.

Sqerl lets you describe SQL queries using a combination of Erlang lists, tuples, atoms and values in a way that resembles the structure of SQL statements. You can pass this structure to the sql/1 or sql/2 functions, which parse it and return an iolist (a tree of strings and/or binaries) or a single binary, either of which can be sent to database engine through a socket (usually via a database-specific driver).

Sqerl supports a large subset of the SQL language implemented by some popular RDBMS's, including most common INSERT, UPDATE, DELETE and SELECT statements. Sqerl can generate complex queries including those with unions, nested statements and aggregate functions, but it does not currently attempt to cover every feature and extension of the SQL language.

Sqerl's benefits are:

  • Easy dynamic generation of SQL queries from Erlang by combining native Erlang types rather than string fragments.
  • Prevention of most, if not all, SQL injection attacks by assuring that all string values are properly escaped.
  • Efficient generation of iolists as nested lists of binaries.

Warning: Sqerl allows you to write verbatim WHERE clauses as well as verbatim LIMIT and other trailing clauses, but using this feature is highly discouraged because it exposes you to SQL injection attacks.

For usage examples, look at the file test/sqerl_tests.erl.

Acknowledgements

Almost entirely based on ErlyWeb's ErlSQL by Yariv Sadan.

More Repositories

1

poison

An incredibly fast, pure Elixir JSON library
Elixir
1,975
star
2

poolboy

A hunky Erlang worker pool factory
Erlang
1,503
star
3

sh

Run programs as functions in Elixir
Elixir
143
star
4

execjs

Run JavaScript code from Elixir
Elixir
143
star
5

markdown

A simple Elixir Markdown to HTML conversion library
C
85
star
6

detergent

An emulsifying Erlang SOAP library
Erlang
62
star
7

html-autoprefixer

Autoprefix all CSS inside an html page - CSS inside style tags and inside style attributes.
JavaScript
54
star
8

walrus

Walrus - Mustache-like Templating
Erlang
44
star
9

fresh

The freshest Erlang web framework
Erlang
34
star
10

fotofoo

SproutCore foto foolery
JavaScript
28
star
11

zucchini

An Erlang INI parser
Erlang
27
star
12

clojure-box

An all-in-one installer for Clojure on Windows. Includes syntax highlighting and the REPL, plus enhanced editing with Slime and all of Emacs.
Emacs Lisp
18
star
13

genome

My genomic data
Standard ML
18
star
14

jsonex

JSON for Elixir
Elixir
8
star
15

epgsql_pool

Pooled epgsql connections using Poolboy
Erlang
7
star
16

confit

An Erlang configuration preserver
Erlang
6
star
17

sproutcore-couchdb

SproutCore CouchDB DataSource framework
JavaScript
6
star
18

cardio

A Cython wrapper around card.io
Python
5
star
19

poolboy-benchmark

A super flawed Poolboy benchmark
Erlang
5
star
20

static-site-brunch

Static site support for Brunch
JavaScript
4
star
21

jorge

A simple Erlang DSL for generating XML based on tuples of tuples
Erlang
4
star
22

kaolin

A C++ mud utilizing the STL (please don't judge. I was 15 when I wrote this and my knowledge of OO and patterns was embarrassing)
C++
3
star
23

jsonerl

yet another but slightly different erlang <-> json encoder/decoder
Erlang
3
star
24

peachfuzz

Simple Mustache inspired string substitution microlibrary
JavaScript
3
star
25

torix

TORres Interactive eXecution
C
3
star
26

dateutils

An erlang date manipulation library
Erlang
3
star
27

raiblocks-nodejs

RaiBlocks Node.js library
JavaScript
2
star
28

docker-elixir

Shell
2
star
29

virtio-wl-dkms

The virtio-wl kernel driver (DKMS)
C
2
star
30

kvc

Simple key-value coding for Elixir
Elixir
2
star
31

metalsmith-html-postcss

Metalsmith plugin to process inline CSS in HTML using PostCSS
JavaScript
2
star
32

urlize

Python and PostgreSQL C extensions to urlize strings
C
2
star
33

poison-textual-theme

Poison - A Textual Theme
JavaScript
2
star
34

docker-couchbase

Shell
2
star
35

docker-erlang

Shell
2
star
36

httpestle

Elixir
2
star
37

ember-skeleton

A skeleton application framework using Ember.js and Rake Pipeline
JavaScript
2
star
38

moonpool

Elixir
1
star
39

winked

A suggestive CommonJS linked list implementation
JavaScript
1
star
40

nano-docker

1
star
41

hemi

A Narwhal JavaScript engine
C++
1
star
42

raiblocks-docker

RaiBlocks node Docker definitions
1
star
43

devinus.github.io

HTML
1
star
44

starterkit

JavaScript
1
star
45

docker-minecraft

1
star
46

cloujin

Magical cloud rehosting
1
star
47

uuid4.js

JavaScript
1
star
48

resume

My resume
TeX
1
star
49

posthtml-when

PostHTML plugin for conditional plugins
JavaScript
1
star
50

dl_format_check

Verifies that a given drivers license fits that format for the state (a simple check of validity)
Elixir
1
star
51

canary

A passerine CommonJS binary search tree implementation
JavaScript
1
star
52

fooblock

Cross-browser ad blocker
1
star