Skip to content

Commit 2e963d2

Browse files
committed
Fix auto-detection of MariaDB in Laravel Sail
Closes #136
1 parent 6c1a7d5 commit 2e963d2

8 files changed

Lines changed: 247 additions & 197 deletions

File tree

bun.lock

Lines changed: 194 additions & 176 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

eslint.config.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
const eslint = require('@typescript-eslint/eslint-plugin')
2+
const parser = require('@typescript-eslint/parser')
3+
4+
module.exports = [
5+
{
6+
ignores: ['out/**', 'dist/**', '**/*.d.ts']
7+
},
8+
{
9+
files: ['src/**/*.ts'],
10+
languageOptions: {
11+
parser: parser,
12+
ecmaVersion: 6,
13+
sourceType: 'module'
14+
},
15+
plugins: {
16+
'@typescript-eslint': eslint
17+
},
18+
rules: {
19+
'@typescript-eslint/naming-convention': 'off',
20+
'@typescript-eslint/semi': 'off',
21+
'curly': 'off',
22+
'no-throw-literal': 'warn',
23+
'semi': 'off'
24+
}
25+
}
26+
]

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,4 +334,4 @@
334334
"singleQuote": true,
335335
"arrowParens": "avoid"
336336
}
337-
}
337+
}

src/providers/mysql/laravel-mysql-provider.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export const LaravelMysqlProvider: DatabaseEngineProvider = {
99
name: 'Laravel Mysql (with Sail support)',
1010
type: 'mysql',
1111
id: 'laravel-mysql',
12-
description: 'Laravel MySQL with default .env config or Sail config in docker-compose.yml',
12+
description: 'Laravel MySQL/MariaDB with default .env config or Sail config in docker-compose.yml',
1313
engine: undefined,
1414

1515
async canBeUsedInCurrentWorkspace(): Promise<boolean> {
@@ -27,7 +27,7 @@ export const LaravelMysqlProvider: DatabaseEngineProvider = {
2727
return false;
2828
}
2929

30-
log('Laravel MySQL', 'Checking if Laravel MySQL provider can be used in the current workspace...');
30+
log('Laravel MySQL', 'Checking if Laravel MySQL/MariaDB provider can be used in the current workspace...');
3131
const connection = await getConnectionInEnvFile('mysql', 'mysql2');
3232
log('Laravel MySQL', `Connection status: ${connection ? 'successful' : 'failed'}`);
3333
if (!connection) return false

src/services/laravel/env-file-parser.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@ export async function getConnectionInEnvFile(connection: LaravelConnection, dial
2121
return
2222
}
2323

24-
if (connection !== envConnection) {
24+
if (connection === 'mysql') {
25+
if (envConnection !== 'mysql' && envConnection !== 'mariadb') {
26+
log('Laravel env file parser', `Connection type mismatch: expected "mysql" or "mariadb", found "${envConnection}"`);
27+
return;
28+
}
29+
} else if (connection !== envConnection) {
2530
log('Laravel env file parser', `Connection type mismatch: expected "${connection}", found "${envConnection}"`);
2631
return;
2732
}

src/services/welcome-message-service.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ export function showWelcomeMessage(context: vscode.ExtensionContext) {
3535

3636
showMessageAndButtons(`
3737
DevDb updated to ${currentVersion}.
38-
✨ Now $3 one-time payment for lifetime DevDb Pro. Enjoy!
38+
✨ Fixed auto-detection of MariaDB in Laravel Sail.
39+
✨ Limited offer: *$9* one-time payment for *lifetime* DevDb Pro. Enjoy!
3940
`, context);
4041
}
4142

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)