Skip to content
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

Use GUID instead of UUID #378

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
Setup devcontainer
This probably breaks the test runner from the github action,
but that is for fixing later.
ahjulstad committed Oct 23, 2023
commit 2abca1e0c8ed0083a488da9b57d5597c5c4b9bb0
37 changes: 37 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/debian
{
"dockerComposeFile": "docker-compose.yml",
"service": "devcontainer",
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
"name": "Debian",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"features": {
"ghcr.io/jlaundry/devcontainer-features/mssql-odbc-driver:1": {
"version": "18"
},
"ghcr.io/ahjulstad/mydevcontainerfeatures/mariadb-odbc:latest": {},
"ghcr.io/julialang/devcontainer-features/julia:1.1.1": {
"channel": "beta"
}
},
"containerEnv": {
"JULIA_NUM_THREADS": "4"
},
"customizations": {
"vscode": {
"extensions": [
"ms-azuretools.vscode-docker",
"julialang.language-julia"
]
}
}
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Configure tool-specific properties.
// "customizations": {},
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
49 changes: 49 additions & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
version: '3.8'
services:
devcontainer:
image: mcr.microsoft.com/devcontainers/base:bullseye
# image: mcr.microsoft.com/devcontainers/base:ubuntu
volumes:
- ../..:/workspaces:cached
- dotjulia:/home/vscode/.julia
network_mode: service:mariadb
command: sleep infinity

mariadb:
image: mariadb:latest
# NOTE: use of "mysql_native_password" is not recommended: https://dev.mysql.com/doc/refman/8.0/en/upgrading-from-previous-series.html#upgrade-caching-sha2-password
# (this is just an example, not intended to be a production configuration)
# command: --default-authentication-plugin=mysql_native_password
restart: always
networks:
- services_network
environment:
# MYSQL_ROOT_PASSWORD: examplepwd
MYSQL_ALLOW_EMPTY_PASSWORD: 1
ports:
- 3306:3306

msdb:
image: mcr.microsoft.com/mssql/server:2022-preview-ubuntu-22.04
restart: unless-stopped
networks:
- services_network
volumes:
- db-data:/var/lib/postgresql/data
environment:
ACCEPT_EULA: 'Y'
MSSQL_SA_PASSWORD: msSQ_F123
MSSQL_PID: Evaluation
ports:
- 1433:1433

networks:
services_network:
driver: bridge

volumes:
db-data:

dotjulia:
external: true
name: dotjulia
6 changes: 3 additions & 3 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ if Sys.islinux()
if Int == Int32
libpath = joinpath(expanduser("~"), "mariadb32/lib/libmaodbc.so")
else
libpath = joinpath("/home/runner/mariadb64", "mariadb-connector-odbc-3.1.11-ubuntu-focal-amd64/lib64/mariadb/libmaodbc.so")
libpath = joinpath("/usr/local/lib/mariadb64", "mariadb-connector-odbc-3.1.19-ubuntu-focal-amd64/lib/mariadb/libmaodbc.so")
end
elseif Sys.iswindows()
if Int == Int32
@@ -291,8 +291,8 @@ ret = ODBC.columns(conn, tablename="emp%", columnname="望研") |> columntable
DBInterface.execute(conn, """DROP USER IF EXISTS 'authtest'""")
DBInterface.execute(conn, """CREATE USER 'authtest' IDENTIFIED BY 'authtestpw'""")

connstrconn = DBInterface.connect(ODBC.Connection, "Driver={MariaDB ODBC 3.1 Driver};SERVER=127.0.0.1;PLUGIN_DIR=$PLUGIN_DIR;Option=67108864;CHARSET=utf8mb4"; user="authtest", password="authtestpw")
@test connstrconn.dsn == "Driver={MariaDB ODBC 3.1 Driver};SERVER=127.0.0.1;PLUGIN_DIR=$PLUGIN_DIR;Option=67108864;CHARSET=utf8mb4"
connstrconn = DBInterface.connect(ODBC.Connection, "Driver={ODBC_Test_MariaDB};SERVER=127.0.0.1;PLUGIN_DIR=$PLUGIN_DIR;Option=67108864;CHARSET=utf8mb4"; user="authtest", password="authtestpw")
@test connstrconn.dsn == "Driver={ODBC_Test_MariaDB};SERVER=127.0.0.1;PLUGIN_DIR=$PLUGIN_DIR;Option=67108864;CHARSET=utf8mb4"
ret = DBInterface.execute(connstrconn, "select current_user() as user") |> columntable
@test startswith(ret.user[1], "authtest@")
DBInterface.close!(connstrconn)
2 changes: 1 addition & 1 deletion test/testmsodbc.jl
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ else
# libpath = MariaDB_Connector_ODBC_jll.libmaodbc_path
end

mssql = ODBC.Connection("Driver={ODBC Driver 18 for SQL Server};Server=127.0.0.1;Encrypt=no", "sa", "msSQ_F123")
mssql = ODBC.Connection("Driver={ODBC Driver 18 for SQL Server};Server=msdb;Encrypt=no", "sa", "msSQ_F123")

res = DBInterface.execute(mssql,
"SELECT CONVERT(uniqueidentifier, 'ABCD0000-0000-0000-1234-000000000000') AS anid, 'ABCD0000-0000-0000-1234-000000000000' AS strid",