Skip to content

Commit 9511964

Browse files
cursoragentlovasoa
andcommitted
Update rpath to include sqlpage directory for ODBC drivers
Co-authored-by: contact <contact@ophir.dev>
1 parent 83efc1a commit 9511964

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

.cargo/config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
LIBSQLITE3_FLAGS = "-DSQLITE_ENABLE_MATH_FUNCTIONS"
88

99
[build]
10-
rustflags = ["-C", "link-arg=-Wl,-rpath=$ORIGIN/lib"]
10+
rustflags = ["-C", "link-arg=-Wl,-rpath=$ORIGIN/sqlpage:$ORIGIN/lib"]

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ ENV SQLPAGE_WEB_ROOT=/var/www
6868
ENV SQLPAGE_CONFIGURATION_DIRECTORY=/etc/sqlpage
6969
WORKDIR /var/www
7070
COPY --from=builder /usr/src/sqlpage/sqlpage.bin /usr/local/bin/sqlpage
71-
# Provide runtime helper libs next to the binary for rpath=$ORIGIN/lib
72-
RUN mkdir -p /usr/local/bin/lib
73-
COPY --from=builder /opt/sqlpage-libs/* /usr/local/bin/lib/
71+
# Provide runtime helper libs next to the binary for rpath=$ORIGIN/sqlpage
72+
RUN mkdir -p /usr/local/bin/sqlpage
73+
COPY --from=builder /opt/sqlpage-libs/* /usr/local/bin/sqlpage/
7474
USER sqlpage
7575
COPY --from=builder --chown=sqlpage:sqlpage /usr/src/sqlpage/sqlpage/sqlpage.db sqlpage/sqlpage.db
7676
EXPOSE 8080

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ You can skip this section if you want to use one of the built-in database driver
190190
191191
SQLPage supports ODBC connections to connect to databases that don't have native drivers, such as Oracle, Snowflake, BigQuery, IBM DB2, and many others.
192192

193-
On Linux, the SQLPage binary and Docker image now statically link against the `unixODBC` driver manager, so you generally do not need to install `unixodbc` on the host anymore. You still need to install the database-specific ODBC driver for the database you want to connect to.
193+
On Linux, the SQLPage binary and Docker image now statically link against the `unixODBC` driver manager, so you generally do not need to install `unixodbc` on the host anymore. You still need to install the database-specific ODBC driver for the database you want to connect to. SQLPage also searches for drivers in a `sqlpage/` directory placed next to the executable (rpath includes `$ORIGIN/sqlpage`). You can drop driver `.so` files there when packaging a self-contained application.
194194

195195
#### Install ODBC
196196

0 commit comments

Comments
 (0)