Generate complex SQL queries in Elixir using intuitive path-based syntax without requiring models or explicit joins.
SqlDust is an Elixir library that generates SQL queries using a simple, path-based syntax. It solves the problem of verbose and complex query building in traditional ORMs by automatically inferring table joins from naming conventions, eliminating the need for model definitions and explicit join configurations.
Elixir developers working with relational databases who want a lightweight, intuitive alternative to Ecto's query DSL for rapid SQL generation, especially those dealing with complex joins or ad-hoc queries.
Developers choose SqlDust because it dramatically reduces boilerplate, requires no learning curve for a custom DSL, and integrates seamlessly with Ecto while providing more intuitive path-based querying and automatic join inference.
Easy. Simple. Powerful. Generate (complex) SQL queries using magical Elixir SQL dust.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Enables referencing columns across tables using dot notation (e.g., 'company.category.name'), automatically inferring joins based on naming conventions, as demonstrated in the README examples.
Offers a fluent, pipe-friendly interface for building queries step-by-step with functions like select and where, allowing dynamic and readable query construction.
Generates SQL directly from Ecto schemas, maintaining compatibility with Elixir's popular database wrapper, as shown in the Ecto model examples.
Supports switching between MySQL and PostgreSQL dialects seamlessly, with automatic adapter detection for Ecto models, ensuring cross-database flexibility.
Returns parameterized queries with safe value interpolation by default, preventing SQL injection vulnerabilities, as highlighted in the features list.
The README's TODO list admits missing features like 'has through' and polymorphic associations, which are essential for complex relational models.
Automatic join inference only works with standard naming conventions; custom schemas require manual overrides, adding setup complexity for non-standard databases.
Lacks built-in query execution and only generates SQL strings, forcing reliance on other libraries for database interaction, unlike Ecto which handles both.
The project acknowledges in its TODO that additional documentation is needed, and features like automatic adapter derivation are unimplemented, indicating maturity issues.