File tree Expand file tree Collapse file tree 8 files changed +38
-34
lines changed Expand file tree Collapse file tree 8 files changed +38
-34
lines changed Original file line number Diff line number Diff line change @@ -28,19 +28,11 @@ install:
28
28
- ci/install-instantclient.sh
29
29
- ci/install-ocilib.sh
30
30
31
- # before_script:
32
- # - docker --version
33
- # - docker pull alexeiled/docker-oracle-xe-11g
34
- # - docker run -d --name oracle -p 1521:1521 -v $(pwd)/sql:/etc/entrypoint-initdb.d alexeiled/docker-oracle-xe-11g
35
-
36
-
37
31
# This line does all of the work: installs GHC if necessary, build the library,
38
32
# executables, and test suites, and runs the test suites. --no-terminal works
39
33
# around some quirks in Travis's terminal implementation.
40
34
script :
41
- - stack --no-terminal --install-ghc build --test --no-run-tests
42
- - LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH .stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/test/test
43
- - cat /etc/ld.so.conf
35
+ - stack --no-terminal --install-ghc build --test
44
36
45
37
# Caching so the next build will be fast too.
46
38
cache :
Original file line number Diff line number Diff line change 2
2
3
3
set -ex
4
4
5
- cd ~
6
- wget https://storage.googleapis.com/oracle.fpinsight.com/instantClient/instantclient-basiclite-linux.x64-12.1.0.2.0.zip
7
- wget https://storage.googleapis.com/oracle.fpinsight.com/instantClient/instantclient-sdk-linux.x64-12.1.0.2.0.zip
8
- unzip instantclient-basiclite-linux.x64-12.1.0.2.0.zip
9
- sudo cp instantclient_12_1/lib* /usr/local/lib/
10
- sudo ln -s /usr/local/lib/libclntsh.so.12.1 /usr/local/lib/libclntsh.so
11
- ln -s $HOME /instantclient_12_1/libclntsh.so.12.1 $HOME /instantclient_12_1/libclntsh.so
12
- unzip instantclient-sdk-linux.x64-12.1.0.2.0.zip
5
+ cd /tmp
6
+
7
+ wget https://storage.googleapis.com/oracle.fpinsight.com/instantClient/oracle-instantclient12.1-basiclite_12.1.0.2.0-2_amd64.deb
8
+ sudo dpkg -i oracle-instantclient12.1-basiclite_12.1.0.2.0-2_amd64.deb
9
+ rm -f oracle-instantclient12.1-basiclite_12.1.0.2.0-2_amd64.deb
10
+ wget https://storage.googleapis.com/oracle.fpinsight.com/instantClient/oracle-instantclient12.1-devel_12.1.0.2.0-2_amd64.deb
11
+ sudo dpkg -i oracle-instantclient12.1-devel_12.1.0.2.0-2_amd64.deb
12
+ rm -f oracle-instantclient12.1-devel_12.1.0.2.0-2_amd64.deb
13
+ sudo echo " /usr/lib/oracle/12.1/client64/lib" > /etc/ld.so.conf.d/oracle-client.conf
14
+ sudo ldconfig
Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
2
set -ex
3
3
4
- cd ~
5
- wget https://storage.googleapis.com/oracle.fpinsight.com/instantClient/ocilib-4.2.1.tar.gz
6
- tar xvf ocilib-4.2.1.tar.gz
7
- cd ocilib-4.2.1 \
8
- && ./configure --with-oracle-import=linkage \
9
- --with-oracle-charset=ansi \
10
- --with-oracle-headers-path=$HOME /instantclient_12_1/sdk/include \
11
- --with-oracle-lib-path=$HOME /instantclient_12_1 \
12
- && make \
13
- && sudo make install
4
+ wget https://github.com/vrogier/ocilib/archive/v4.2.1.tar.gz
5
+ tar xvf v4.2.1.tar.gz
6
+ cd /tmp/ocilib-4.2.1
7
+
8
+ ./configure --with-oracle-import=linkage \
9
+ --with-oracle-charset=ansi \
10
+ --with-oracle-headers-path=/usr/include/oracle/12.1/client64 \
11
+ --with-oracle-lib-path=/usr/lib/oracle/12.1/client64/lib \
12
+ make
13
+ sudo make install
14
+ cd
15
+ rm -rf /tmp/ocilib-4.2.1
16
+ sudo echo " /usr/local/lib" > /etc/ld.so.conf.d/usr-local.conf
17
+ sudo ldconfig
Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
2
3
3
docker run -d --name oracle --shm-size=2g -p 1521:1521 -v $( pwd) /sql:/etc/entrypoint-initdb.d alexeiled/docker-oracle-xe-11g
4
-
5
- # user: system/oracle@localhost:1521/xe
Original file line number Diff line number Diff line change @@ -62,6 +62,7 @@ library
62
62
63
63
cc-options : -Wall
64
64
extra-libraries : ocilib
65
+ extra-lib-dirs : /usr/local/lib
65
66
66
67
build-depends : base >= 4.8 && < 5
67
68
, containers >= 0.5 && < 1
@@ -79,6 +80,9 @@ test-suite test
79
80
80
81
default-language : Haskell2010
81
82
83
+ extra-libraries : ocilib
84
+ extra-lib-dirs : /usr/local/lib
85
+
82
86
build-depends : base
83
87
, bytestring
84
88
, hocilib
Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ import Foreign.Ptr
54
54
import qualified Language.C.Inline as C
55
55
import Database.Ocilib.Oci
56
56
import Database.Ocilib.Enums
57
+ import Database.Ocilib.Internal
57
58
58
59
C. context (C. baseCtx <> C. funCtx <> ociCtx)
59
60
@@ -62,8 +63,8 @@ C.include "<ocilib.h>"
62
63
-- Executing Statements
63
64
64
65
-- | Create a statement object and return its handle.
65
- ociStatementCreate :: Ptr OCI_Connection -> IO (Ptr OCI_Statement )
66
- ociStatementCreate c = [C. exp | OCI_Statement* { OCI_StatementCreate($(OCI_Connection *c)) } |]
66
+ ociStatementCreate :: Ptr OCI_Connection -> IO (Maybe ( Ptr OCI_Statement ) )
67
+ ociStatementCreate c = fmap toMaybePtr [C. exp | OCI_Statement* { OCI_StatementCreate($(OCI_Connection *c)) } |]
67
68
68
69
-- | Free a statement and all resources associated to it (resultsets ...)
69
70
ociStatementFree :: Ptr OCI_Statement -> IO Bool
Original file line number Diff line number Diff line change 1
- resolver : lts-6.12
1
+ resolver : lts-6.13
2
2
packages :
3
3
- ' .'
4
4
extra-deps : []
5
5
flags : {}
6
6
extra-package-dbs : []
7
7
extra-include-dirs : []
8
8
extra-lib-dirs : []
9
+ docker :
10
+ enable : false
11
+ repo : mystack:latest
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ fetchTest = do
35
35
case maybeC of
36
36
Nothing -> assertFailure " failed to create connection"
37
37
Just c -> do
38
- st <- ociStatementCreate c
38
+ Just st <- ociStatementCreate c
39
39
b <- ociExecuteStmt st " select * from test_fetch"
40
40
assertBool " ociExecuteStatement" b
41
41
@@ -113,7 +113,7 @@ testStringBinding = do
113
113
case maybeC of
114
114
Nothing -> assertFailure " unable to connect"
115
115
Just c -> do
116
- st <- ociStatementCreate c
116
+ Just st <- ociStatementCreate c
117
117
ociSetBindAllocation st OCI_BAM_INTERNAL
118
118
b <- ociPrepare st " select * from test_fetch where article=(:article)"
119
119
assertBool " prepared" b
You can’t perform that action at this time.
0 commit comments