-
Notifications
You must be signed in to change notification settings - Fork 3
feat: add-mssql-support #56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
bfe63d7
c6baa8f
8690a15
90eea7d
30b5cc9
6c22949
32b46d6
86564d5
525c07b
a6e005c
d2f3aec
5514532
de0e918
8910ae7
84a596e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,4 +3,7 @@ | |
| /src/data/ | ||
|
|
||
| .DS_Store | ||
| .env | ||
| .env | ||
|
|
||
| .claude | ||
| /docs | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -100,4 +100,14 @@ port = 3050 | |||||||||||||
| host = "db-firebird" | ||||||||||||||
| generated_id = "16706124-ff7e-4c97-8c83-0adeff214681" | ||||||||||||||
|
|
||||||||||||||
| [[databases]] | ||||||||||||||
| name = "Test database 13 - MSSQL" | ||||||||||||||
| database = "myappdb" | ||||||||||||||
| type = "mssql" | ||||||||||||||
| username = "sa" | ||||||||||||||
| password = "Portabase!Strong1" | ||||||||||||||
| port = 1433 | ||||||||||||||
|
Comment on lines
+107
to
+109
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Avoid committing a concrete SA password in tracked config. Line 108 hardcodes a privileged credential. Please switch to a non-sensitive placeholder and source real values from environment-specific config that is not committed. Suggested diff username = "sa"
-password = "Portabase!Strong1"
+password = "changeme" # override via env/local untracked config
port = 1433📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||
| host = "db-mssql" | ||||||||||||||
| generated_id = "16706125-ff7e-4c97-8c83-0adeff214682" | ||||||||||||||
|
|
||||||||||||||
|
|
||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,6 +22,20 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ | |
| && apt-get clean \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| ENV DOTNET_ROOT=/usr/local/dotnet | ||
| RUN curl -sSL https://dot.net/v1/dotnet-install.sh -o /tmp/dotnet-install.sh \ | ||
| && chmod +x /tmp/dotnet-install.sh \ | ||
| && /tmp/dotnet-install.sh --channel 8.0 --install-dir /usr/local/dotnet \ | ||
| && rm /tmp/dotnet-install.sh \ | ||
| && /usr/local/dotnet/dotnet tool install --global microsoft.sqlpackage | ||
|
|
||
| ENV PATH="$PATH:/usr/local/dotnet:/root/.dotnet/tools" | ||
|
|
||
| RUN ARCH=$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/') \ | ||
| && curl -sSL "https://github.com/microsoft/go-sqlcmd/releases/latest/download/sqlcmd-linux-${ARCH}.tar.bz2" \ | ||
| | tar -xjf - -C /usr/local/bin sqlcmd \ | ||
| && chmod +x /usr/local/bin/sqlcmd | ||
|
|
||
| ARG TARGETARCH | ||
|
|
||
| # ========================= | ||
|
|
@@ -97,12 +111,18 @@ RUN apt-get update && apt-get install -y \ | |
| libreadline8 \ | ||
| libncurses6 \ | ||
| zlib1g \ | ||
| curl \ | ||
| mariadb-client \ | ||
| sqlite3 \ | ||
| redis-tools \ | ||
| valkey \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| ENV DOTNET_ROOT=/usr/local/dotnet | ||
| RUN curl -sSL https://dot.net/v1/dotnet-install.sh -o /tmp/dotnet-install.sh \ | ||
| && chmod +x /tmp/dotnet-install.sh \ | ||
| && /tmp/dotnet-install.sh --channel 8.0 --runtime dotnet --install-dir /usr/local/dotnet \ | ||
| && rm /tmp/dotnet-install.sh | ||
|
|
||
|
Comment on lines
+121
to
126
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Test that sqlpackage works in the production image
# Build the production image
echo "Building production image..."
docker build --target prod -t portabase-prod-test -f docker/Dockerfile .
# Test sqlpackage availability and execution
echo "Testing sqlpackage in production image..."
docker run --rm portabase-prod-test /bin/bash -c "
which sqlpackage && \
sqlpackage /version || echo 'ERROR: sqlpackage failed to execute'
"Repository: Portabase/agent Length of output: 241 🏁 Script executed: cat -n docker/Dockerfile | sed -n '20,140p'Repository: Portabase/agent Length of output: 4336 🌐 Web query:
💡 Result: SqlPackage (.NET) runtime and system requirements (as of the latest Microsoft Learn guidance): 1) OS requirements (the same minimum OS requirements apply to both the dotnet-tool install and the self-contained.zip) - Windows (x64): Windows 11; Windows 10 (1607+); Windows Server Core 2012 R2+; Windows Server 2012 R2+ [1] - macOS (x64): macOS 14 “Sonoma”+ [1] - Linux (x64): Debian 12+; Red Hat Enterprise Linux 8+; SUSE Linux Enterprise Server 15 SP6+; Ubuntu 22.04+ [1] 2).NET runtime requirement (depends on how you install SqlPackage) - dotnet tool install (recommended): Installing SqlPackage as a global dotnet tool “requires the.NET SDK to be installed on your machine.” Also, SqlPackage is available as a dotnet tool for.NET 8 and later versions. [1] - Self-contained.zip download: “No.NET install is required” for the self-contained zip. [1] - SqlPackage built on.NET 10: Microsoft states “SqlPackage runs on Windows, macOS, and Linux and is built using.NET 10.” [1] So, if you use the recommended dotnet-tool method, ensure you have the.NET SDK (and a compatible.NET 8+ environment). If you use the self-contained.zip, you don’t need a separate.NET installation; just meet the OS requirements above. [1] Citations: Resolve: sqlpackage requires .NET SDK but production image installs only runtime. The base image installs The solution is either:
🤖 Prompt for AI Agents |
||
| WORKDIR /app | ||
|
|
||
|
|
@@ -113,8 +133,9 @@ RUN chmod +x /entrypoint.sh | |
|
|
||
| COPY --from=base /usr/lib/postgresql/ /usr/lib/postgresql/ | ||
| COPY --from=base /usr/local/mongodb/bin/ /usr/local/mongodb/bin/ | ||
| COPY --from=base /root/.dotnet/tools/ /root/.dotnet/tools/ | ||
|
|
||
|
|
||
| ENV PATH="$PATH:/usr/local/dotnet:/root/.dotnet/tools" | ||
| ENV APP_ENV=production | ||
|
|
||
| CMD ["/entrypoint.sh"] | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -45,11 +45,17 @@ seed-firebird: | |||||||||||||||||||||||||||||||||||||||
| echo "SELECT RDB\$RELATION_NAME FROM RDB\$RELATIONS WHERE RDB\$SYSTEM_FLAG = 0 AND RDB\$VIEW_BLR IS NULL;" \ | ||||||||||||||||||||||||||||||||||||||||
| | docker exec -i db-firebird isql -user alice -password fake_password /var/lib/firebird/data/mirror.fdb | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| seed-mssql: | ||||||||||||||||||||||||||||||||||||||||
| echo "Seeding MSSQL..." | ||||||||||||||||||||||||||||||||||||||||
| docker exec -i rust-dev sqlcmd -S "db-mssql,1433" -U sa -P "$MSSQL_SA_PASSWORD" -N disable -i /app/scripts/mssql/seed.sql | ||||||||||||||||||||||||||||||||||||||||
| echo "Done" | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| seed-all: | ||||||||||||||||||||||||||||||||||||||||
| just seed-mongo | ||||||||||||||||||||||||||||||||||||||||
| just seed-mysql | ||||||||||||||||||||||||||||||||||||||||
| just seed-postgres | ||||||||||||||||||||||||||||||||||||||||
| just seed-postgres-1gb | ||||||||||||||||||||||||||||||||||||||||
| just seed-sqlite | ||||||||||||||||||||||||||||||||||||||||
| just seed-mongo | ||||||||||||||||||||||||||||||||||||||||
| just seed-firebird | ||||||||||||||||||||||||||||||||||||||||
| just seed-firebird | ||||||||||||||||||||||||||||||||||||||||
| just seed-mssql | ||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
53
to
+61
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove the duplicate Mongo seed call in
Suggested diff seed-all:
just seed-mongo
just seed-mysql
just seed-postgres
just seed-postgres-1gb
just seed-sqlite
- just seed-mongo
just seed-firebird
just seed-mssql📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix typo in database name: "MysSQL" → "MSSQL".
The database name contains a typo: "Test database 13 - MysSQL" should be "Test database 13 - MSSQL".
📝 Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents