{"repo":"alexdesousa/ayesql","free":true,"listed":false,"github":"https://github.com/alexdesousa/ayesql","clone":"git clone https://github.com/alexdesousa/ayesql.git","description":"Library for using raw SQL in Elixir","language":"Elixir","stars":146,"topics":["yesql","elixir","raw-sql","postgresql","postgrex","ecto"],"license":"MIT","category":"databases-storage","readme_excerpt":"AyeSQL Aye /ʌɪ/ exclamation (archaic dialect) : said to express assent; yes. AyeSQL is a library for using raw SQL. Overview Inspired by Clojure library Yesql, AyeSQL tries to find a middle ground between strings with raw SQL queries and SQL DSLs. This library aims to: - Keep SQL in SQL files. - Generate easy to use Elixir functions for every query. - Parameterize queries using maps and keyword lists. - Allow query composablity. - Support loading from multiple files or glob patterns. - Work out-of-the-box with PostgreSQL using Ecto or Postgrex. - Work out-of-the-box with DuckDB using Duckdbex. If you want to know more about AyeSQL: - Small example - Multi-file support - Syntax + Naming queries + Parameters + Mandatory parameters + Query composition + Optional fragments + IN statement + Subqueries and subfragments - Installation And the following additional links provide more information about the library: - Full Documentation - AyeSQL: Writing Raw SQL in Elixir - Why raw SQL? - Dynamic queries with EEx - Adding support to other databases Small Example In AyeSQL, the equivalent would be to create an SQL file with the query e.g. queries.sql : In Elixir, we would load all the queries in this file by creating the following module: or using the macro defqueries/3 : Note : The file name used in defqueries macro should be relative to the file where the macro is used. Both approaches will create a module called Queries with all the queries defined in queries.sql . And then we could e","default_branch":null,"files":null,"tree":[],"storefront":"/r/alexdesousa","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/alexdesousa/ayesql/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}