seaquell
Namespaces are OrganizedHere’s how the src
files are organized.
Defines the primary DSL syntax for creating, rendering, and executing SQL statements.
Provides a number of public API functions for altering existing select statements.
Transforms SQL statement values (maps) into SQL strings.
Transforms sequences of SQL tokens to SQL strings and provides a number of helper functions for defining parenthesized value tuples.
Executes SQL strings using the clojure.java.jdbc
library.
Provides a number of internal utility functions, mostly predicates, used by other seaquell
namespaces.
Uses clojure.spec.alpha
to define specs for some of the DSL.
Provides a few public functions for working with SQLite databases.
Provides solutions to a number of SQLZoo tutorials on using select statements.
Here’s how the test
files are organized.
The two files below comprised the primary DSL tests in early versions of seaquell
.
This approach tested the generation of SQL values and the tranformation of SQL values separately.
However, in my opinion, reading these tests is of more value to a developer than a user and recent tests are targeted more toward library users.
Tests that core DSL syntax functions produce the correct data value.
Tests the transformation of SQL data values (statements, clauses, and properties) to SQL strings.
Incomplete testing of some of the functions used to edit select statements.
Tests the public raw
function.
Tests the use of SQL tokens.
Uses an in-memory database to work through an exercise on using SQL CRUD operations.
Tests some of the functions in the sqlite
namespace.
My testing philosophy has evolved since starting the project. With more recent commits, the primary purpose of the tests is to show how to use the DSL. The secondary purpose is to confirm the DSL works as intended. Newer tests exercise statement creation and rendering or execution together, rather than separately. As a consequence, newer tests may be closer to integration tests than unit tests, but they work better to document DSL usage.
The following seaquell
namespaces use the new approach:
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close