Skip to content

Iterable/saferis

 
 

Repository files navigation

saferis

Scala CI Maven Repository

The name is derived from 'safe' and 'eris' (Greek for 'strife' or 'discord')

Saferis mitigates the discord of unsafe SQL. A type-safe, resource-safe SQL client library for Scala 3 and ZIO.

Key Features

  • SQL Injection Protection - Safe SQL interpolator with compile-time validation
  • Multi-Database Support - Works with PostgreSQL, MySQL, SQLite, and any JDBC database
  • Type-Safe Capabilities - Operations only available when your database supports them
  • Resource Safety - Guaranteed connection and transaction management with ZIO
  • Label-Based Decoding - Column-to-field mapping by name, not position
  • Compile-Time Validation - Table schemas, column names, and SQL verified at compile time
  • Unified Query Builder - Type-safe joins, subqueries, and pagination in one fluent API
  • Streaming - queryStream for real-time row iteration; pagedStream/seekingStream for cursor-based pagination with connection release between pages and checkpoint support for resumable processing

Installation

Add to your build.sbt:

libraryDependencies += "io.github.russwyte" %% "saferis" % "<version>"

Database Dialects

Saferis provides compile-time guarantees that operations are only available when your database supports them:

Feature PostgreSQL MySQL SQLite
RETURNING clause Yes No Yes
JSON operations Yes Yes No
Array types Yes No No
UPSERT Yes No No

Switch databases by changing one import - your code adapts automatically:

import saferis.*                 // PostgreSQL (default)
import saferis.mysql.{given}     // Override with MySQL
import saferis.sqlite.{given}    // Override with SQLite

See the full documentation for:

  • Complete API reference
  • Running examples with real database output
  • Dialect system details
  • DDL and DML operations
  • Advanced pagination patterns

License

Apache 2.0

About

A type safe SQL client and interpolator for Scala 3 and ZIO

Resources

License

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Scala 100.0%