forked from zio-archive/zio-sql
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into reacquire-dead-conns
- Loading branch information
Showing
22 changed files
with
810 additions
and
283 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package zio.sql | ||
|
||
import zio._ | ||
import zio.stream.ZStream | ||
import zio.schema.Schema | ||
|
||
trait ExprSyntaxModule { self: Jdbc => | ||
implicit final class ReadSyntax[A](self: Read[A]) { | ||
def run: ZStream[SqlTransaction, Exception, A] = | ||
ZStream.serviceWithStream(_.read(self)) | ||
} | ||
|
||
implicit final class DeleteSyntax(self: Delete[_]) { | ||
def run: ZIO[SqlTransaction, Exception, Int] = | ||
ZIO.serviceWithZIO(_.delete(self)) | ||
} | ||
|
||
implicit final class InsertSyntax[A: Schema](self: Insert[_, A]) { | ||
def run: ZIO[SqlTransaction, Exception, Int] = | ||
ZIO.serviceWithZIO(_.insert(self)) | ||
} | ||
|
||
implicit final class UpdatedSyntax(self: Update[_]) { | ||
def run: ZIO[SqlTransaction, Exception, Int] = | ||
ZIO.serviceWithZIO(_.update(self)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.