diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 557214bd3..bbdc12dd9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,6 +50,27 @@ jobs: - run: docker-compose up -d ${DIALECT} - run: docker run --link ${DIALECT}:db -e CHECK_PORT=${SEQ_PORT::-1} -e CHECK_HOST=db --net cli_default giorgos/takis - run: yarn test + test-mariadb: + strategy: + fail-fast: false + matrix: + node-version: [10, 16] + sequelize-version: [5, latest] + name: MariaDB (Node ${{ matrix.node-version }}, Sequelize ${{ matrix.sequelize-version }}) + runs-on: ubuntu-latest + env: + DIALECT: mariadb + SEQ_PORT: 33060 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + - run: yarn install --frozen-lockfile --ignore-engines + - run: yarn add sequelize@${{ matrix.sequelize-version }} --ignore-engines + - run: docker-compose up -d ${DIALECT} + - run: docker run --link ${DIALECT}:db -e CHECK_PORT=${SEQ_PORT::-1} -e CHECK_HOST=db --net cli_default giorgos/takis + - run: yarn test test-sqlite: strategy: fail-fast: false diff --git a/docker-compose.yml b/docker-compose.yml index 614fa862c..7cc14d7c9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -25,3 +25,13 @@ services: ports: - "33060:3306" container_name: mysql + + # MariaDB + mariadb: + image: mariadb:10.3 + environment: + MYSQL_ALLOW_EMPTY_PASSWORD: "yes" + MYSQL_DATABASE: sequelize_test + ports: + - "33060:3306" + container_name: mariadb diff --git a/package.json b/package.json index 168e3e035..2ec292ca6 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,7 @@ "gulp": "4.0.2", "husky": "8.0.3", "lint-staged": "15.0.2", + "mariadb": "2.5.6", "mocha": "9.2.2", "mysql2": "3.2.0", "pg": "latest", diff --git a/src/commands/database.js b/src/commands/database.js index 22c2d59a4..8ad8aa373 100644 --- a/src/commands/database.js +++ b/src/commands/database.js @@ -110,6 +110,7 @@ function getCreateDatabaseQuery(sequelize, config, options) { ); case 'mysql': + case 'mariadb': return ( 'CREATE DATABASE IF NOT EXISTS ' + queryGenerator.quoteIdentifier(config.database) + @@ -164,6 +165,7 @@ function getDatabaseLessSequelize() { break; case 'mysql': + case 'mariadb': delete config.database; break; diff --git a/yarn.lock b/yarn.lock index a5ef5e287..ebfffd778 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1293,6 +1293,11 @@ dependencies: "@types/ms" "*" +"@types/geojson@^7946.0.8": + version "7946.0.12" + resolved "https://registry.yarnpkg.com/@types/geojson/-/geojson-7946.0.12.tgz#0307536218d32e6b970bccd1d148b9c4e5b6f10d" + integrity sha512-uK2z1ZHJyC0nQRbuovXFt4mzXDwf27vQeUWNhfKGwRcWW429GOhP8HxUHlM6TLH4bzmlv/HlEjpvJh3JfmGsAA== + "@types/minimist@^1.2.0": version "1.2.3" resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.3.tgz#dd249cef80c6fff2ba6a0d4e5beca913e04e25f8" @@ -1315,6 +1320,11 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-20.5.1.tgz#178d58ee7e4834152b0e8b4d30cbfab578b9bb30" integrity sha512-4tT2UrL5LBqDwoed9wZ6N3umC4Yhz3W3FloMmiiG4JwmUJWpie0c7lcnUNd4gtMKuDEO4wRVS8B6Xa0uMRsMKg== +"@types/node@^17.0.10": + version "17.0.45" + resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.45.tgz#2c0fafd78705e7a18b7906b5201a522719dc5190" + integrity sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw== + "@types/normalize-package-data@^2.4.0": version "2.4.2" resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.2.tgz#9b0e3e8533fe5024ad32d6637eb9589988b6fdca" @@ -2368,7 +2378,7 @@ delegates@^1.0.0: resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" integrity sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ== -denque@^2.1.0: +denque@^2.0.1, denque@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/denque/-/denque-2.1.0.tgz#e93e1a6569fb5e66f16a3c2a2964617d349d6ab1" integrity sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw== @@ -4118,7 +4128,7 @@ log-update@^5.0.1: strip-ansi "^7.0.1" wrap-ansi "^8.0.1" -long@^5.2.1: +long@^5.2.0, long@^5.2.1: version "5.2.3" resolved "https://registry.yarnpkg.com/long/-/long-5.2.3.tgz#a3ba97f3877cf1d778eccbcb048525ebb77499e1" integrity sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q== @@ -4220,6 +4230,19 @@ map-visit@^1.0.0: dependencies: object-visit "^1.0.0" +mariadb@2.5.6: + version "2.5.6" + resolved "https://registry.yarnpkg.com/mariadb/-/mariadb-2.5.6.tgz#7314e9287cdba212831ebf16ef3b34dc6a1f0f06" + integrity sha512-zBx7loYY5GzLl8Y6AKxGXfY9DUYIIdGrmEORPOK9FEu0pg5ZLBKCGJuucHwKADxTBxKY7eM4rxndqxRcnMZKIw== + dependencies: + "@types/geojson" "^7946.0.8" + "@types/node" "^17.0.10" + denque "^2.0.1" + iconv-lite "^0.6.3" + long "^5.2.0" + moment-timezone "^0.5.34" + please-upgrade-node "^3.2.0" + matchdep@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/matchdep/-/matchdep-2.0.0.tgz#c6f34834a0d8dbc3b37c27ee8bbcb27c7775582e" @@ -4452,7 +4475,7 @@ mocha@9.2.2: yargs-parser "20.2.4" yargs-unparser "2.0.0" -moment-timezone@^0.5.43: +moment-timezone@^0.5.34, moment-timezone@^0.5.43: version "0.5.43" resolved "https://registry.yarnpkg.com/moment-timezone/-/moment-timezone-0.5.43.tgz#3dd7f3d0c67f78c23cd1906b9b2137a09b3c4790" integrity sha512-72j3aNyuIsDxdF1i7CEgV2FfxM1r6aaqJyLB2vwb33mXYyoyLly+F1zbWqhA3/bVIoJ4szlUoMbUnVdid32NUQ== @@ -5070,6 +5093,13 @@ pkg-dir@^3.0.0: dependencies: find-up "^3.0.0" +please-upgrade-node@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz#aeddd3f994c933e4ad98b99d9a556efa0e2fe942" + integrity sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg== + dependencies: + semver-compare "^1.0.0" + posix-character-classes@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" @@ -5490,6 +5520,11 @@ safe-regex@^1.1.0: resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== +semver-compare@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc" + integrity sha512-YM3/ITh2MJ5MtzaM429anh+x2jiLVjqILF4m4oyQB18W7Ggea7BfqdH/wGMK7dDiMghv/6WG7znWMwUDzJiXow== + semver-greatest-satisfied-range@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/semver-greatest-satisfied-range/-/semver-greatest-satisfied-range-1.1.0.tgz#13e8c2658ab9691cb0cd71093240280d36f77a5b"