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.
zio-archive#341 - Implement Ltrim2 and Rtrim2 for Postgres and Oracle
- Loading branch information
Showing
7 changed files
with
56 additions
and
36 deletions.
There are no files selected for viewing
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
25 changes: 25 additions & 0 deletions
25
oracle/src/test/scala/zio/sql/oracle/CustomFunctionDefSpec.scala
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,25 @@ | ||
package zio.sql.oracle | ||
|
||
import zio.test.Assertion._ | ||
import zio.test.TestAspect.timeout | ||
import zio.test._ | ||
import zio._ | ||
|
||
object CustomFunctionDefSpec extends OracleRunnableSpec with DualSchema { | ||
import OracleFunctionDef._ | ||
|
||
import Dual._ | ||
|
||
override def specLayered = suite("Oracle FunctionDef")( | ||
test("ltrim2") { | ||
assertZIO(execute(select(Ltrim2("$## foo$#", "#$")).from(dual)).runHead.some)( | ||
equalTo(" foo$#") | ||
) | ||
}, | ||
test("rtrim2") { | ||
assertZIO(execute(select(Rtrim2("$#foo $##", "#$")).from(dual)).runHead.some)( | ||
equalTo("$#foo ") | ||
) | ||
} | ||
) @@ timeout(5.minutes) | ||
} |
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,14 @@ | ||
package zio.sql.oracle | ||
|
||
import zio.schema.DeriveSchema | ||
import zio.sql.table._ | ||
|
||
trait DualSchema { | ||
object Dual { | ||
case class Dual(dummy: String) | ||
|
||
implicit val dummySchema = DeriveSchema.gen[Dual] | ||
val dual = Table.defineTable[Dual] | ||
val dummy = dual.columns | ||
} | ||
} |
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