Skip to content

Commit

Permalink
Rename project, executables, and library to "SQLFlite" (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
prmoore77 authored Jul 18, 2024
1 parent 90b2322 commit cc7f7fe
Show file tree
Hide file tree
Showing 16 changed files with 172 additions and 166 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/build-docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
runner: macos-13-xlarge
runs-on: ${{ matrix.runner }}
env:
zip_file_name: flight_sql_cli_${{ matrix.os }}_${{ matrix.platform }}.zip
zip_file_name: sqlflite_cli_${{ matrix.os }}_${{ matrix.platform }}.zip
steps:
- name: Checkout
uses: actions/[email protected]
Expand All @@ -46,7 +46,7 @@ jobs:
username: ${{ secrets.APPLE_ID_USERNAME }}
password: ${{ secrets.APPLE_ID_PASSWORD }}
apple-team-id: ${{ secrets.APPLE_TEAM_ID }}
app-path: build/flight_sql_server
app-path: build/sqlflite_server
entitlements-path: macos/entitlements.plist

- name: Sign and notarize the server release build
Expand All @@ -57,12 +57,12 @@ jobs:
username: ${{ secrets.APPLE_ID_USERNAME }}
password: ${{ secrets.APPLE_ID_PASSWORD }}
apple-team-id: ${{ secrets.APPLE_TEAM_ID }}
app-path: build/flight_sql_client
app-path: build/sqlflite_client

- name: Zip artifacts
run: |
mv build/flight_sql_server build/flight_sql_client .
zip -j ${{ env.zip_file_name }} flight_sql_server flight_sql_client
mv build/sqlflite_server build/sqlflite_client .
zip -j ${{ env.zip_file_name }} sqlflite_server sqlflite_client
- name: Upload artifacts
uses: actions/upload-artifact@v4
Expand All @@ -84,7 +84,7 @@ jobs:
runner: buildjet-8vcpu-ubuntu-2204-arm
runs-on: ${{ matrix.runner }}
env:
zip_file_name: flight_sql_cli_${{ matrix.os }}_${{ matrix.platform }}.zip
zip_file_name: sqlflite_cli_${{ matrix.os }}_${{ matrix.platform }}.zip
steps:
- name: Checkout
uses: actions/[email protected]
Expand Down Expand Up @@ -112,8 +112,8 @@ jobs:

- name: Zip artifacts
run: |
mv build/flight_sql_server build/flight_sql_client .
zip -j ${{ env.zip_file_name }} flight_sql_server flight_sql_client
mv build/sqlflite_server build/sqlflite_client .
zip -j ${{ env.zip_file_name }} sqlflite_server sqlflite_client
- name: Upload artifacts
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -167,14 +167,14 @@ jobs:
uses: actions/download-artifact@v4
with:
path: artifacts
pattern: flight_sql_cli_*.zip
pattern: sqlflite_cli_*.zip
merge-multiple: true

- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
artifacts/flight_sql_cli_*.zip
artifacts/sqlflite_cli_*.zip
LICENSE
update-image-manifest:
Expand Down
56 changes: 28 additions & 28 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.25)
project(flight_sql)
project(sqlflite)

set(CMAKE_CXX_STANDARD 17)

Expand Down Expand Up @@ -120,7 +120,7 @@ find_package(Threads REQUIRED)
set(Boost_USE_STATIC_LIBS ON)
find_package(Boost COMPONENTS program_options REQUIRED)

set(ARROW_FLIGHT_SQL_SQLITE_SERVER_SRCS
set(SQLFLITE_SQLITE_SERVER_SRCS
src/sqlite/sqlite_sql_info.cc
src/sqlite/sqlite_type_info.cc
src/sqlite/sqlite_statement.cc
Expand All @@ -129,35 +129,35 @@ set(ARROW_FLIGHT_SQL_SQLITE_SERVER_SRCS
src/sqlite/sqlite_tables_schema_batch_reader.cc)


set(ARROW_FLIGHT_SQL_DUCKDB_SERVER_SRCS
set(SQLFLITE_DUCKDB_SERVER_SRCS
src/duckdb/duckdb_sql_info.cpp
src/duckdb/duckdb_statement.cpp
src/duckdb/duckdb_statement_batch_reader.cpp
src/duckdb/duckdb_server.cpp
src/duckdb/duckdb_tables_schema_batch_reader.cpp)

# Add header file
set(HEADER_FILES src/library/include/flight_sql_library.h)
set(HEADER_FILES src/library/include/sqlflite_library.h)

# Add a library target
add_library(flightsqlserver STATIC
src/library/flight_sql_library.cpp
src/library/flight_sql_security.cpp
${ARROW_FLIGHT_SQL_SQLITE_SERVER_SRCS}
${ARROW_FLIGHT_SQL_DUCKDB_SERVER_SRCS}
add_library(sqlfliteserver STATIC
src/library/sqlflite_library.cpp
src/library/sqlflite_security.cpp
${SQLFLITE_SQLITE_SERVER_SRCS}
${SQLFLITE_DUCKDB_SERVER_SRCS}
)

set_target_properties(flightsqlserver PROPERTIES PUBLIC_HEADER ${HEADER_FILES})
set_target_properties(sqlfliteserver PROPERTIES PUBLIC_HEADER ${HEADER_FILES})

target_include_directories(flightsqlserver PRIVATE
target_include_directories(sqlfliteserver PRIVATE
src/sqlite
src/duckdb
${SQLITE_INCLUDE_DIR}
${DUCKDB_INCLUDE_DIR}
${JWT_CPP_INCLUDE_DIR}
)

target_link_libraries(flightsqlserver
target_link_libraries(sqlfliteserver
PRIVATE
Threads::Threads
ArrowFlightSql::arrow_flight_sql_static
Expand All @@ -169,39 +169,39 @@ target_link_libraries(flightsqlserver

if (APPLE)
# macOS-specific libraries and options
target_link_libraries(flightsqlserver PRIVATE "-framework CoreFoundation")
target_link_libraries(sqlfliteserver PRIVATE "-framework CoreFoundation")
elseif (UNIX AND NOT APPLE)
target_link_libraries(flightsqlserver PRIVATE "-lssl -lcrypto")
target_link_libraries(sqlfliteserver PRIVATE "-lssl -lcrypto")
endif ()

# Specify the installation directory for the library
install(TARGETS flightsqlserver
install(TARGETS sqlfliteserver
LIBRARY DESTINATION lib
PUBLIC_HEADER DESTINATION include
)

# ------------ Server Executable section ------------
add_executable(flight_sql_server
src/flight_sql_server.cpp
add_executable(sqlflite_server
src/sqlflite_server.cpp
)

target_link_libraries(flight_sql_server PRIVATE
flightsqlserver
target_link_libraries(sqlflite_server PRIVATE
sqlfliteserver
${Boost_LIBRARIES}
)

target_compile_options(flight_sql_server PRIVATE "-static")
target_compile_options(sqlflite_server PRIVATE "-static")

install(TARGETS flight_sql_server
install(TARGETS sqlflite_server
DESTINATION bin
)

# ------------ Client Executable section ------------
add_executable(flight_sql_client
src/flight_sql_client.cpp
add_executable(sqlflite_client
src/sqlflite_client.cpp
)

target_link_libraries(flight_sql_client PRIVATE
target_link_libraries(sqlflite_client PRIVATE
Threads::Threads
ArrowFlightSql::arrow_flight_sql_static
${Boost_LIBRARIES}
Expand All @@ -210,13 +210,13 @@ target_link_libraries(flight_sql_client PRIVATE

if (APPLE)
# macOS-specific libraries and options
target_link_libraries(flight_sql_client PRIVATE "-framework CoreFoundation")
target_link_libraries(sqlflite_client PRIVATE "-framework CoreFoundation")
elseif (UNIX AND NOT APPLE)
target_link_libraries(flight_sql_client PRIVATE "-lssl -lcrypto")
target_link_libraries(sqlflite_client PRIVATE "-lssl -lcrypto")
endif ()

target_compile_options(flight_sql_client PRIVATE "-static")
target_compile_options(sqlflite_client PRIVATE "-static")

install(TARGETS flight_sql_client
install(TARGETS sqlflite_client
DESTINATION bin
)
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ RUN case ${TARGETPLATFORM} in \
# Create an application user
RUN useradd app_user --create-home

ARG APP_DIR=/opt/flight_sql
ARG APP_DIR=/opt/sqlflite

RUN mkdir --parents ${APP_DIR} && \
chown app_user:app_user ${APP_DIR} && \
Expand Down Expand Up @@ -103,6 +103,6 @@ RUN case ${TARGETPLATFORM} in \
EXPOSE 31337

# Run a test to ensure that the server works...
RUN scripts/test_flight_sql.sh
RUN scripts/test_sqlflite.sh

ENTRYPOINT scripts/start_flight_sql.sh
ENTRYPOINT scripts/start_sqlflite.sh
12 changes: 6 additions & 6 deletions Dockerfile-slim.ci
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ RUN apt-get update && \
# Create an application user
RUN useradd app_user --create-home

ARG APP_DIR=/opt/flight_sql
ARG APP_DIR=/opt/sqlflite

RUN mkdir --parents ${APP_DIR} && \
chown app_user:app_user ${APP_DIR} && \
Expand All @@ -34,12 +34,12 @@ WORKDIR ${APP_DIR}
# Copy the scripts directory into the image (we copy directory-by-directory in order to maximize Docker caching)
COPY --chown=app_user:app_user scripts scripts

COPY --chown=app_user:app_user flight_sql_server /usr/local/bin/flight_sql_server
RUN chmod +x /usr/local/bin/flight_sql_server
COPY --chown=app_user:app_user sqlflite_server /usr/local/bin/sqlflite_server
RUN chmod +x /usr/local/bin/sqlflite_server

COPY --chown=app_user:app_user flight_sql_client /usr/local/bin/flight_sql_client
RUN chmod +x /usr/local/bin/flight_sql_client
COPY --chown=app_user:app_user sqlflite_client /usr/local/bin/sqlflite_client
RUN chmod +x /usr/local/bin/sqlflite_client

EXPOSE 31337

ENTRYPOINT scripts/start_flight_sql_slim.sh
ENTRYPOINT scripts/start_sqlflite_slim.sh
14 changes: 7 additions & 7 deletions Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ RUN case ${TARGETPLATFORM} in \
# Create an application user
RUN useradd app_user --create-home

ARG APP_DIR=/opt/flight_sql
ARG APP_DIR=/opt/sqlflite

RUN mkdir --parents ${APP_DIR} && \
chown app_user:app_user ${APP_DIR} && \
Expand Down Expand Up @@ -72,11 +72,11 @@ RUN python "scripts/create_duckdb_database_file.py" \
--overwrite-file=true \
--scale-factor=0.01

COPY --chown=app_user:app_user flight_sql_server /usr/local/bin/flight_sql_server
RUN chmod +x /usr/local/bin/flight_sql_server
COPY --chown=app_user:app_user sqlflite_server /usr/local/bin/sqlflite_server
RUN chmod +x /usr/local/bin/sqlflite_server

COPY --chown=app_user:app_user flight_sql_client /usr/local/bin/flight_sql_client
RUN chmod +x /usr/local/bin/flight_sql_client
COPY --chown=app_user:app_user sqlflite_client /usr/local/bin/sqlflite_client
RUN chmod +x /usr/local/bin/sqlflite_client

COPY --chown=app_user:app_user tls tls

Expand All @@ -94,6 +94,6 @@ RUN case ${TARGETPLATFORM} in \
EXPOSE 31337

# Run a test to ensure that the server works...
RUN scripts/test_flight_sql.sh
RUN scripts/test_sqlflite.sh

ENTRYPOINT scripts/start_flight_sql.sh
ENTRYPOINT scripts/start_sqlflite.sh
Loading

0 comments on commit cc7f7fe

Please sign in to comment.