Skip to content

Commit

Permalink
More MySQL switching
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelborn committed Jan 16, 2025
1 parent 4b61a1b commit 0f3e48a
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 9 deletions.
35 changes: 35 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
MYSQL_HOST=localhost
MYSQL_PORT=3306
MYSQL_DATABASE=myDB
MYSQL_USERNAME=root
MYSQL_PASSWORD=123456Password

# MARIADB_HOST=localhost
# MARIADB_PORT=3309
# MARIADB_DATABASE=myDB
# MARIADB_USERNAME=root
# MARIADB_PASSWORD=123456Password

# POSTGRES_HOST=localhost
# POSTGRES_PORT=5432
# POSTGRES_DATABASE=myDB
# POSTGRES_USERNAME=postgres
# POSTGRES_PASSWORD=123456Password

# ORACLE_HOST=localhost
# ORACLE_PORT=1521
# ORACLE_DATABASE=myDB
# ORACLE_USERNAME=postgres
# ORACLE_PASSWORD=123456Password

# MSSQL_HOST=localhost
# MSSQL_PORT=1433
# MSSQL_DATABASE=master
# MSSQL_USERNAME=sa
# MSSQL_PASSWORD=123456Password

# HYPERSQL_HOST=localhost
# HYPERSQL_PORT=???
# HYPERSQL_DATABASE=myDB
# HYPERSQL_USER=xyz
# HYPERSQL_PASSWORD=123456Password
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ build/**
bin/
!gradle/wrapper/gradle-wrapper.jar

# Secrets
.env

# Log files and derby artifacts
derby.log

Expand Down
11 changes: 3 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,6 @@ dependencies {
testImplementation "org.junit.jupiter:junit-jupiter:5.+"
testImplementation "org.mockito:mockito-core:5.+"
testImplementation "com.google.truth:truth:1.+"
// @TODO: Figure out why we need this for running tests - they should be included in the boxlang dep.
// https://mvnrepository.com/artifact/ch.qos.logback/logback-classic
//testImplementation 'ch.qos.logback:logback-classic:1.5.7'
// https://mvnrepository.com/artifact/com.zaxxer/HikariCP
testImplementation 'com.zaxxer:HikariCP:5.1.0'
}

java {
Expand Down Expand Up @@ -223,7 +218,7 @@ task downloadBoxLang( type: Download ) {
// Configure the URL of the file to download
src([
"https://downloads.ortussolutions.com/ortussolutions/boxlang/${boxlangVersion}/boxlang-${boxlangVersion}-all.jar",
"https://downloads.ortussolutions.com/ortussolutions/boxlang-modules/bx-derby/${derbyVersion}/bx-derby-${derbyVersion}.zip"
"https://downloads.ortussolutions.com/ortussolutions/boxlang-modules/bx-mysql/${mysqlVersion}/bx-mysql-${mysqlVersion}.zip"
])
// Specify the destination directory for the downloaded files
dest "src/test/resources/libs/"
Expand All @@ -235,8 +230,8 @@ task downloadBoxLang( type: Download ) {
* Install any dependencies the module needs
*/
task installModuleDependencies( dependsOn: downloadBoxLang, type: Copy ) {
from zipTree( file( "${testResourceDirectory}/libs/bx-derby-${derbyVersion}.zip" ) )
into "${testResourceDirectory}/modules/bx-derby"
from zipTree( file( "${testResourceDirectory}/libs/bx-mysql-${mysqlVersion}.zip" ) )
into "${testResourceDirectory}/modules/bx-mysql"
}

/**
Expand Down
39 changes: 39 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
services:
mysql:
platform: linux/x86_64 # Needed for Mac's on the M1 chip
image: mysql:5
environment:
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_ROOT_PASSWORD: ${MYSQL_PASSWORD}
ports:
- "${MYSQL_PORT}:3306"

# mariadb:
# image: mariadb:latest
# environment:
# MYSQL_ROOT_PASSWORD: ${MARIADB_PASSWORD}
# MYSQL_DATABASE: ${MARIADB_DATABASE}
# # MYSQL_USER: myuser
# # MYSQL_PASSWORD: mypassword
# # volumes:
# # - ./data:/var/lib/mysql
# ports:
# - "${MARIADB_PORT}:3306"

# postgres:
# image: postgres:11.3
# environment:
# POSTGRES_USER: ${POSTGRES_USERNAME}
# POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
# POSTGRES_DB: ${POSTGRES_DATABASE}
# ports:
# - "${POSTGRES_PORT}:5432"

# mssql:
# image: mcr.microsoft.com/mssql/server:2019-latest
# environment:
# MSSQL_SA_PASSWORD: ${MSSQL_PASSWORD}
# ACCEPT_EULA: "Y"
# MSSQL_PID: "Developer"
# ports:
# - "${MSSQL_PORT}:1433"
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
version=1.0.0
group=ortus.boxlang
boxlangVersion=1.0.0-snapshot
derbyVersion=1.1.0
mysqlVersion=1.0.0
jdkVersion=21

0 comments on commit 0f3e48a

Please sign in to comment.