-0 selda-0.1.5.0[back to package description]
Selda
What is Selda?
Selda is an embedded domain-specific language for interacting with relational databases. It was inspired by LINQ and Opaleye.
Features
- Monadic interface: no need to be a category theory wizard just to write a few database queries.
- Portable: backends for SQLite and PostgreSQL.
- Generic: easy integration with your existing Haskell types.
- Creating, dropping and querying tables using type-safe database schemas.
- Typed query language with products, filtering, joins and aggregation.
- Inserting, updating and deleting rows from tables.
- Transactions, uniqueness constraints and foreign keys.
- Configurable, automatic, consistent in-process caching of query results.
- Lightweight and modular:  |
Also note that
def can only be used for columns that have default values.
Currently, only auto-incrementing primary keys can have defaults.
Attempting to use
def in any other context results in a runtime error.  (count city :*: owner'))
And with that, we conclude this tutorial. Hopefully it has been enough to get you comfortable started using Selda. For a more detailed API reference, please see Selda's Haddock documentation.
TODOs
Features that would be nice to have but are not yet implemented.
- If/else.
- Streaming
- Type-safe migrations
WHERE x IN (SELECT ...)
SELECT INTO.
- Database schema upgrades.
- Stack build.
- MySQL/MariaDB backend.