A Clojure library that introspects PostgreSQL databases at compile time to generate clojure.spec definitions and automate CRUD queries.
Specql is a Clojure library that automates PostgreSQL CRUD queries by introspecting the database schema at compile time. It generates clojure.spec definitions for tables and columns, allowing developers to write type-safe queries using namespaced keywords. This reduces boilerplate code and ensures data integrity through Clojure's spec system.
Clojure developers working with PostgreSQL databases who want to reduce repetitive CRUD code and leverage type-safe queries. It's particularly useful for projects where database schema integrity and compile-time validation are priorities.
Developers choose Specql because it eliminates manual spec definition for database entities, provides automatic type-safe query generation, and integrates seamlessly with Clojure's spec system. Its focus on common CRUD operations while deferring complex queries to SQL offers a pragmatic balance between automation and flexibility.
Automatic PostgreSQL CRUD queries
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Introspects PostgreSQL database schema at compile time to automatically generate clojure.spec definitions for tables and columns, eliminating manual spec writing as shown in the define-tables example.
Uses namespaced keywords for tables and columns in queries, ensuring correctness through Clojure's spec system and reducing boilerplate for common operations like fetch, insert, and update.
Supports PostgreSQL user-defined composite types as nested Clojure maps and integrates database views and materialized views seamlessly, extending functionality beyond basic tables.
Allows custom transformations, such as converting database enums to keywords, providing flexibility in data handling without manual conversion code.
Only supports PostgreSQL, so it cannot be used with other database systems, limiting its applicability in polyglot or migrating environments.
Explicitly defers complex SQL queries to manual writing or other libraries, making it unsuitable for projects needing advanced joins or reporting without additional tools.
Relies on compile-time introspection, which can be problematic for databases with dynamic schemas or frequent changes, requiring recompilation and potential caching issues.