add support for oracle type size units 'char' and 'byte', example: varchar2(55 byte)
This commit is contained in:
parent
b23f3aaa07
commit
ff3dcb814c
4 changed files with 36 additions and 0 deletions
tools/Language/SQL/SimpleSQL
29
tools/Language/SQL/SimpleSQL/Oracle.lhs
Normal file
29
tools/Language/SQL/SimpleSQL/Oracle.lhs
Normal file
|
@ -0,0 +1,29 @@
|
|||
|
||||
Tests for oracle dialect parsing
|
||||
|
||||
> module Language.SQL.SimpleSQL.Oracle (oracleTests) where
|
||||
|
||||
> import Language.SQL.SimpleSQL.TestTypes
|
||||
> import Language.SQL.SimpleSQL.Syntax
|
||||
|
||||
> oracleTests :: TestItem
|
||||
> oracleTests = Group "oracle dialect"
|
||||
> [oracleLobUnits]
|
||||
|
||||
|
||||
> oracleLobUnits :: TestItem
|
||||
> oracleLobUnits = Group "oracleLobUnits" (map (uncurry (TestScalarExpr oracle))
|
||||
> [("cast (a as varchar2(3 char))"
|
||||
> ,Cast (Iden [Name Nothing "a"]) (
|
||||
> PrecLengthTypeName [Name Nothing "varchar2"] 3 Nothing (Just PrecCharacters)))
|
||||
> ,("cast (a as varchar2(3 byte))"
|
||||
> ,Cast (Iden [Name Nothing "a"]) (
|
||||
> PrecLengthTypeName [Name Nothing "varchar2"] 3 Nothing (Just PrecOctets)))
|
||||
> ]
|
||||
> ++ [TestStatement oracle
|
||||
> "create table t (a varchar2(55 BYTE));"
|
||||
> $ CreateTable [Name Nothing "t"]
|
||||
> [TableColumnDef $ ColumnDef (Name Nothing "a")
|
||||
> (PrecLengthTypeName [Name Nothing "varchar2"] 55 Nothing (Just PrecOctets))
|
||||
> Nothing []]]
|
||||
> )
|
|
@ -37,6 +37,7 @@ test data to the Test.Framework tests.
|
|||
> import Language.SQL.SimpleSQL.SQL2011Schema
|
||||
|
||||
> import Language.SQL.SimpleSQL.MySQL
|
||||
> import Language.SQL.SimpleSQL.Oracle
|
||||
|
||||
Order the tests to start from the simplest first. This is also the
|
||||
order on the generated documentation.
|
||||
|
@ -60,6 +61,7 @@ order on the generated documentation.
|
|||
> ,sql2011AccessControlTests
|
||||
> ,sql2011BitsTests
|
||||
> ,mySQLTests
|
||||
> ,oracleTests
|
||||
> ]
|
||||
|
||||
> tests :: T.TestTree
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue