Git Product home page Git Product logo

zio-sql's Introduction

ZIO SQL

Project Stage CI Release Snapshot Discord
Project stage CI Release Artifacts Snapshot Artifacts badge-discord

Current status: Non-production release

Progress report towards 0.1

✔️ - good to go

✅ - some more work needed

General features:

Feature Progress
Type-safe schema ✔️
Type-safe DSL ✔️
Running Reads ✔️
Running Deletes ✔️
Running Updates ✔️
Running Inserts ✔️
Transactions
Connection pool

Db-specific features:

Feature PostgreSQL SQL Server Oracle MySQL
Render Read ✔️ ✔️ ✔️ ✔️
Render Delete ✔️ ✔️
Render Update ✔️
Render Insert ✔️
Functions ✔️
Types
Operators

What is ZIO SQL?

ZIO SQL lets you write type-safe, type-inferred, and composable SQL queries in ordinary Scala, helping you prevent persistence bugs before they happen, and leverage your IDE to make writing SQL productive, safe, and fun.

  • Type-safety. ZIO SQL queries are type-safe by construction. Most classes of bugs can be detected at compile-time, shortening your feedback loop and helping you use your IDE to write correct queries.
  • Composable. All ZIO SQL components are ordinary values, which can be transformed and composed in sensible ways. This uniformity and regularity means you have a lot of power in a small package.
  • Type-inferred. ZIO SQL uses maximal variance and lower-kinded types, which means it features very good type inference. You can let Scala figure out the types required for type-safe SQL.
  • No magic. ZIO SQL does not need any macros or plug-ins to operate (everything is a value!), and it works across both Scala 2.x and Scala 3. Optionally, Scala schema can be created from database schemas.

ZIO SQL can be used as a library for modeling SQL in a type-safe ADT. In addition, ZIO SQL has a JDBC interface, which utilizes the type-safe SQL ADT for interacting with common JDBC databases.

For the JDBC module:

  • Like Slick, ZIO SQL has an emphasis on type-safe SQL construction using Scala values and methods. However, ZIO SQL utilizes reified lenses, contravariant intersection types, and in-query nullability to improve ergonomics for end-users. Unlike Slick, the intention is to use names resembling SQL instead of trying to mimic the Scala collections.
  • Like Doobie, ZIO SQL is purely functional, but ZIO SQL does compile-time query validation that catches most issues, and has rich ZIO integration, offering improved type-safety compared to monofunctor effects and minimal dependencies (depending only on ZIO).

ZIO SQL does not offer Language Integrated Queries (LINQ) or similar functionality. It is intended only as a data model for representing SQL queries and an accompanying lightweight JDBC-based executor.

Setup

Prerequisites (installed):

Technology Version
sbt 1.4.3
Docker 3.1

To set up the project follow below steps:

  1. Fork the repository.
  2. Setup the upstream (Extended instructions can be followed here).
  3. Make sure you have installed sbt and Docker.
  4. In project directory execute sbt test.
  5. Pick up an issue & you are ready to go!

If you want to learn more, please check out:

zio-sql's People

Contributors

jczuchnowski avatar scala-steward avatar sviezypan avatar jdegoes avatar robmwalsh avatar lemastero avatar mehulumistry avatar riccardocorbella avatar antoniograndinetti avatar maciejbak85 avatar adamgfraser avatar pjazdzewski1990 avatar fokot avatar jessenr avatar shankarshastri avatar petoalbert avatar kidonm avatar visar avatar andrewhj avatar brbrown25 avatar danieletorelli avatar tobiaspfeifer avatar marekklis avatar porcupine96 avatar regiskuckaertz avatar peixunzhang avatar angelicarao avatar sushengloong avatar gantu avatar xplosunn avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.