Skip to content

Commit 2bdb511

Browse files
Merge pull request #8 from danielmeppiel/add-thick-mode
Add thick mode compatibility
2 parents d15a385 + 244d535 commit 2bdb511

File tree

6 files changed

+168
-82
lines changed

6 files changed

+168
-82
lines changed

Dockerfile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,36 @@
11
FROM ghcr.io/astral-sh/uv:0.6.6-python3.12-bookworm
22

3+
# Install Oracle Instant Client dependencies
4+
RUN apt-get update && apt-get install -y \
5+
libaio1 \
6+
unzip \
7+
&& rm -rf /var/lib/apt/lists/*
8+
9+
# Download and install Oracle Instant Client based on architecture
10+
WORKDIR /opt/oracle
11+
12+
# Set up architecture-specific variables
13+
ARG TARGETARCH
14+
RUN if [ "$TARGETARCH" = "amd64" ]; then \
15+
ORACLE_CLIENT_URL="https://download.oracle.com/otn_software/linux/instantclient/2370000/instantclient-basic-linux.x64-23.7.0.25.01.zip"; \
16+
elif [ "$TARGETARCH" = "arm64" ]; then \
17+
ORACLE_CLIENT_URL="https://download.oracle.com/otn_software/linux/instantclient/2370000/instantclient-basic-linux.arm64-23.7.0.25.01.zip"; \
18+
else \
19+
echo "Unsupported architecture: $TARGETARCH" && exit 1; \
20+
fi && \
21+
echo "Downloading Oracle Instant Client 23.7 for $TARGETARCH" && \
22+
curl -o instantclient.zip $ORACLE_CLIENT_URL && \
23+
unzip instantclient.zip && \
24+
rm instantclient.zip && \
25+
cd instantclient* && \
26+
echo /opt/oracle/instantclient_23_7 > /etc/ld.so.conf.d/oracle-instantclient.conf && \
27+
ldconfig
28+
29+
# Set Oracle environment variables
30+
ENV LD_LIBRARY_PATH=/opt/oracle/instantclient_23_7:$LD_LIBRARY_PATH
31+
ENV ORACLE_HOME=/opt/oracle/instantclient_23_7
32+
ENV DPI_DEBUG_LEVEL=64
33+
334
# Copy the project into the image
435
ADD . /app
536

db_context/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88

99
class DatabaseContext:
10-
def __init__(self, connection_string: str, cache_path: Path, target_schema: Optional[str] = None):
11-
self.db_connector = DatabaseConnector(connection_string, target_schema)
10+
def __init__(self, connection_string: str, cache_path: Path, target_schema: Optional[str] = None, use_thick_mode: bool = False):
11+
self.db_connector = DatabaseConnector(connection_string, target_schema, use_thick_mode)
1212
self.schema_manager = SchemaManager(self.db_connector, cache_path)
1313
# Set the schema manager reference in the connector
1414
self.db_connector.set_schema_manager(self.schema_manager)

0 commit comments

Comments
 (0)