2024-01-09 01:07:47 +01:00
|
|
|
|
|
|
|
-- Tests for oracle dialect parsing
|
|
|
|
|
2024-01-10 08:40:24 +01:00
|
|
|
{-# LANGUAGE OverloadedStrings #-}
|
2024-01-09 01:07:47 +01:00
|
|
|
module Language.SQL.SimpleSQL.Oracle (oracleTests) where
|
|
|
|
|
|
|
|
import Language.SQL.SimpleSQL.TestTypes
|
|
|
|
import Language.SQL.SimpleSQL.Syntax
|
2024-02-04 17:00:59 +01:00
|
|
|
import Language.SQL.SimpleSQL.TestRunners
|
2024-01-09 01:07:47 +01:00
|
|
|
|
|
|
|
oracleTests :: TestItem
|
|
|
|
oracleTests = Group "oracle dialect"
|
|
|
|
[oracleLobUnits]
|
|
|
|
|
|
|
|
|
|
|
|
oracleLobUnits :: TestItem
|
2024-02-04 17:00:59 +01:00
|
|
|
oracleLobUnits = Group "oracleLobUnits"
|
|
|
|
[testScalarExpr oracle "cast (a as varchar2(3 char))"
|
|
|
|
$ Cast (Iden [Name Nothing "a"]) (
|
|
|
|
PrecLengthTypeName [Name Nothing "varchar2"] 3 Nothing (Just PrecCharacters))
|
|
|
|
,testScalarExpr oracle "cast (a as varchar2(3 byte))"
|
|
|
|
$ Cast (Iden [Name Nothing "a"]) (
|
|
|
|
PrecLengthTypeName [Name Nothing "varchar2"] 3 Nothing (Just PrecOctets))
|
|
|
|
,testStatement oracle
|
2024-01-09 01:07:47 +01:00
|
|
|
"create table t (a varchar2(55 BYTE));"
|
|
|
|
$ CreateTable [Name Nothing "t"]
|
|
|
|
[TableColumnDef $ ColumnDef (Name Nothing "a")
|
2024-09-02 18:25:37 +02:00
|
|
|
(Just (PrecLengthTypeName [Name Nothing "varchar2"] 55 Nothing (Just PrecOctets)))
|
2024-09-02 19:06:33 +02:00
|
|
|
[]]
|
2024-07-11 21:59:58 +02:00
|
|
|
False
|
2024-02-04 17:00:59 +01:00
|
|
|
]
|
2024-07-11 21:59:58 +02:00
|
|
|
|