Skip to content

Commit

Permalink
Drop mariadb support (#2681)
Browse files Browse the repository at this point in the history
* Dropped support for mariasql

* ESLint
  • Loading branch information
elhigu committed Jul 1, 2018
1 parent b349ac4 commit e2f617b
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 283 deletions.
3 changes: 0 additions & 3 deletions package.json
Expand Up @@ -39,7 +39,6 @@
"estraverse": "^4.2.0",
"istanbul": "^0.4.5",
"json-loader": "^0.5.7",
"mariasql": "^0.2.6",
"mocha": "^3.5.3",
"mock-fs": "^4.4.2",
"mssql": "^4.1.0",
Expand Down Expand Up @@ -101,7 +100,6 @@
"query",
"postgresql",
"mysql",
"mariadb",
"sqlite3",
"oracle",
"mssql"
Expand All @@ -117,7 +115,6 @@
"mssql": false,
"mysql": false,
"mysql2": false,
"mariasql": false,
"pg": false,
"pg-query-stream": false,
"oracle": false,
Expand Down
171 changes: 0 additions & 171 deletions src/dialects/maria/index.js

This file was deleted.

39 changes: 0 additions & 39 deletions src/dialects/maria/transaction.js

This file was deleted.

2 changes: 0 additions & 2 deletions src/index.js
Expand Up @@ -9,8 +9,6 @@ import { assign } from 'lodash'

// The client names we'll allow in the `{name: lib}` pairing.
const aliases = {
'mariadb' : 'maria',
'mariasql' : 'maria',
'pg' : 'postgres',
'postgresql' : 'postgres',
'sqlite' : 'sqlite3'
Expand Down
11 changes: 3 additions & 8 deletions src/util/parse-connection.js
Expand Up @@ -5,9 +5,6 @@ import { parse as parsePG } from 'pg-connection-string'
export default function parseConnectionString(str) {
const parsed = url.parse(str)
let { protocol } = parsed
if (protocol && protocol.indexOf('maria') === 0) {
protocol = 'maria'
}
if (protocol === null) {
return {
client: 'sqlite3',
Expand All @@ -34,11 +31,9 @@ function connectionObject(parsed) {
if (db[0] === '/') {
db = db.slice(1)
}
if (parsed.protocol.indexOf('maria') === 0) {
connection.db = db
} else {
connection.database = db
}

connection.database = db

if (parsed.hostname) {
if (parsed.protocol.indexOf('mssql') === 0) {
connection.server = parsed.hostname;
Expand Down
1 change: 0 additions & 1 deletion test/index.js
Expand Up @@ -22,7 +22,6 @@ describe('Query Building Tests', function() {

require('./unit/query/builder')
require('./unit/schema/mysql')('mysql')
require('./unit/schema/mysql')('maria')
require('./unit/schema/mysql')('mysql2')
require('./unit/schema/postgres')
require('./unit/schema/redshift')
Expand Down
15 changes: 4 additions & 11 deletions test/integration/builder/additional.js
Expand Up @@ -250,7 +250,6 @@ module.exports = function(knex) {
var tables = {
mysql: 'SHOW TABLES',
mysql2: 'SHOW TABLES',
mariadb: 'SHOW TABLES',
postgresql: "SELECT table_name FROM information_schema.tables WHERE table_schema='public'",
redshift: "SELECT table_name FROM information_schema.tables WHERE table_schema='public'",
sqlite3: "SELECT name FROM sqlite_master WHERE type='table';",
Expand Down Expand Up @@ -536,9 +535,6 @@ module.exports = function(knex) {
'mysql2': function() {
return knex.raw('SELECT SLEEP(1)');
},
mariadb: function() {
return knex.raw('SELECT SLEEP(1)');
},
mssql: function() {
return knex.raw('WAITFOR DELAY \'00:00:01\'');
},
Expand Down Expand Up @@ -587,9 +583,6 @@ module.exports = function(knex) {
'mysql2': function() {
return knex.raw('SELECT SLEEP(10)');
},
mariadb: function() {
return knex.raw('SELECT SLEEP(10)');
},
mssql: function() {
return knex.raw('WAITFOR DELAY \'00:00:10\'');
},
Expand All @@ -608,8 +601,8 @@ module.exports = function(knex) {
return query.timeout(200, {cancel: true});
}

// Only mysql/mariadb query cancelling supported for now
if (!_.startsWith(dialect, "mysql") && !_.startsWith(dialect, "maria")) {
// Only mysql query cancelling supported for now
if (!_.startsWith(dialect, "mysql")) {
expect(addTimeout).to.throw("Query cancelling not supported for this dialect");
return;
}
Expand Down Expand Up @@ -643,9 +636,9 @@ module.exports = function(knex) {


it('.timeout(ms, {cancel: true}) should throw error if cancellation cannot acquire connection', function() {
// Only mysql/mariadb query cancelling supported for now
// Only mysql query cancelling supported for now
var dialect = knex.client.config.dialect;
if (!_.startsWith(dialect, "mysql") && !_.startsWith(dialect, "maria")) {
if (!_.startsWith(dialect, "mysql")) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion test/integration/migrate/index.js
Expand Up @@ -330,7 +330,7 @@ module.exports = function(knex) {
// MySQL / Oracle commit transactions implicit for most common
// migration statements (e.g. CREATE TABLE, ALTER TABLE, DROP TABLE),
// so we need to check for dialect
if (knex.client.dialect === 'mysql' || knex.client.dialect === 'mariadb' || knex.client.dialect === 'oracle') {
if (knex.client.dialect === 'mysql' || knex.client.dialect === 'oracle') {
expect(exists).to.equal(true);
} else {
expect(exists).to.equal(false);
Expand Down
6 changes: 3 additions & 3 deletions test/integration/schema/index.js
Expand Up @@ -124,8 +124,8 @@ module.exports = function(knex) {
});
});

describe('increments types - mysql/maria', function() {
if(!knex || !knex.client || (!(/mysql/i.test(knex.client.dialect)) && !(/maria/i.test(knex.client.dialect)))) {
describe('increments types - mysql', function() {
if(!knex || !knex.client || (!(/mysql/i.test(knex.client.dialect)))) {
return Promise.resolve();
}

Expand Down Expand Up @@ -695,7 +695,7 @@ module.exports = function(knex) {
describe('mysql only', function() {
if (!knex ||
!knex.client ||
(!(/mysql/i.test(knex.client.dialect)) && !(/maria/i.test(knex.client.dialect)))
(!(/mysql/i.test(knex.client.dialect)))
) {
return Promise.resolve();
}
Expand Down

0 comments on commit e2f617b

Please sign in to comment.