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

Feature Request: Support for TablePlus #22

Open
sc0ttkclark opened this issue Apr 24, 2024 · 0 comments
Open

Feature Request: Support for TablePlus #22

sc0ttkclark opened this issue Apr 24, 2024 · 0 comments
Labels
[Type] Feature Request A shiny new thing

Comments

@sc0ttkclark
Copy link

sc0ttkclark commented Apr 24, 2024

What

I'd like to see a TablePlus option in the "Open in..." section so I can immediately one-click jump into the DB via GUI.

Why

TablePlus is supported by other local site apps like Local and I enjoy the ease-of-use for that flow. I use TablePlus for all of my DB connections on various projects for both remote and local DBs.

How

Various areas of the code reference vscode/phpstorm so those places would also need to support tableplus.

TablePlus is at /Applications/TablePlus.app on macOS.

The main area where the logic for how to use the installed status would be just below the PhpStorm option in https://github.com/Automattic/studio/blob/trunk/src/components/content-tab-overview.tsx

This would be a new if conditional that could look something like this:

if ( installedApps.tableplus ) {
		buttonsArray.push( {
			label: 'TablePlus',
			className: 'text-nowrap',
			icon: connection,
			onClick: async () => {
				try {
					await getIpcApi().openURL( `sqlite://@${ encodeURIComponent( selectedSite.path ) }%2Fwp-content%2Fdatabase%2F.ht.sqlite/.ht.sqlite?statusColor=686B6F&env=local&name=Studio%20%3E%20${ encodeURIComponent( selectedSite.path ) }&tLSMode=0&usePrivateKey=false&safeModeLevel=0&advancedSafeModeLevel=0&driverVersion=0&lazyload=true` );
				} catch ( error ) {
					Sentry.captureException( error );
					alert(
						sprintf(
							__( "Could not open the database in %s. Please check if it's installed correctly." ),
							'TablePlus'
						)
					);
				}
			},
		} );
	}

The connection icon would need to be imported at the top of the file as well.

This is just kind of an example of what that might look like, the logic may need to change during testing.

@sc0ttkclark sc0ttkclark added the [Type] Enhancement Improvement upon an existing feature label Apr 24, 2024
@wojtekn wojtekn added [Type] Feature Request A shiny new thing and removed [Type] Enhancement Improvement upon an existing feature labels Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Feature Request A shiny new thing
Projects
None yet
Development

No branches or pull requests

2 participants