{"repo":"tylerbarker/sql_kit","free":true,"listed":false,"github":"https://github.com/tylerbarker/sql_kit","clone":"git clone https://github.com/tylerbarker/sql_kit.git","description":"Execute raw SQL in strings or .sql files with Ecto, get maps and structs back.","language":"Elixir","stars":32,"topics":["ecto","elixir","elixir-lang","sql","clickhouse","mariadb","mysql","postgresql","sql-server","sqlite"],"license":"MIT","category":"databases-storage","readme_excerpt":"SqlKit Hex GitHub Documentation Execute raw SQL in strings or .sql files, get maps and structs back. Built on top of ecto sql. SqlKit provides two ways to execute SQL with automatic result transformation: 1. Direct SQL execution - Execute SQL strings directly with any Ecto repo 2. File-based SQL - Keep SQL in dedicated files with compile-time embedding Why? Sometimes raw SQL is the right tool for the job. Complex analytical queries, reports with intricate joins, or database-specific features often demand SQL that's awkward to express through an ORM. You can do this already with Repo.query , however this returns a result struct with separate columns and rows lists. SqlKit handles this for you, returning maps [%{id: 1, name: \"Alice\"}, ...] or structs [%User{id: 1, name: \"Alice\"}, ...] directly. For file-based SQL, keeping queries in .sql files brings other practical benefits like syntax highlighting, and SQL formatter support. It also makes your codebase more accessible to SQL-fluent team members who can read, review, and contribute queries without needing to learn Elixir first. How .sql files are loaded is configurable by environment: Reading from disk in development for fast iteration, and embedding at compile time in production to eliminate unnecessary I/O. Features - Just SQL : No DSL or special syntax to learn. - Automatic result transformation : Query results returned as maps or structs, not raw columns/rows - Two APIs : Execute SQL strings directly or load from files - C","default_branch":null,"files":null,"tree":[],"storefront":"/r/tylerbarker","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/tylerbarker/sql_kit/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."}