mtxr / vscode-sqltools

Database management for VSCode
https://vscode-sqltools.mteixeira.dev?utm_source=github&utm_medium=homepage-link
MIT License
1.49k stars 301 forks source link

ODBC/JDBC support #44

Closed FireFighter1017 closed 4 years ago

FireFighter1017 commented 6 years ago

This is a guideline to help us to understand SQLTools Issues.

You don't need to stick to this, but please try to guide us to reproduce the errors or understand your feature requests.

Issue Type

Prerequisites (For bugfixes)

Description

I would like to connect not only to MSSQL or MySQL but also to DB2, CSV, Access, etc. using ODBC or JDBC.

Steps to Reproduce (For bugfixes)

  1. [First Step]
  2. [Second Step]
  3. [and so on...]

Expected behavior: [What you expected to happen] Connection config that allows for JDBC connection and URL No need to define supported drivers, as this would come along with PATH or CLASSPATH

Actual behavior: [What actually happened]

Versions

You can get this information from executing SQLTools: Version from VSCode Quick Open.

mtxr commented 6 years ago

Hello @FireFighter1017!

Could you provide some queries to:

Like in mysql.ts file?

With that, it will help me to start this FT.

mtxr commented 6 years ago

@BuZZ-dEE, @SimonDever and @dakaraphi. Feel free to help too.

FireFighter1017 commented 6 years ago

DB2 for i5OS (using sql naming convention):

MS Access:

As for CSV, I was just fishing. I'm not sure it is possible to query CSV files using SQL without having some sort of interpreter in between that can execute SQL statements using python, ruby or R. Most obvious way would be to import the CSVs in MSSQL and run queries from there. Some sort of script that would handle this would be nice though.

Though this is not written in code like in your mysql.ts file, I can have a look later today and see if I can contribute to create one for DB2 at very least.

cmarin1983 commented 6 years ago

Will you have support for Sybase?

ZuluagaSD commented 5 years ago

Will this help with connecting to an Impala DB using the Impala ODBC?

BrettMoan commented 5 years ago

Any ideas on what kind of work would need done to add this functionality? It something I could see myself using at work if you were able to get it working. Depending on what skills would be needed to implement I could try and set aside some personal time to contribute.

mtxr commented 5 years ago

I'm currently working to add Oracle and SQLite. If we succeed, I will be able to add this functionality too :pray:

adainz commented 5 years ago

If you could also add support for Teradata that would be amazing!

mtxr commented 5 years ago

Hey guys, could you please submit a pull request of this feature?

As you are a user that understands the needs for ODBC/JDBC, you could follow this structure (https://github.com/mtxr/vscode-sqltools/tree/master/packages/core/dialect/sqlite) to accomplish the same result. Is it ok?

As you can see, it's not difficult, it's almost to define the queries it needs to run.

That's the first step. After creating the dialect, we just need to add it to the UI.

Thanks!

mtxr commented 5 years ago

Does anyone know a good npm package, supporting all platforms and widely used?

I'll work on this issue soon, so I want to get all information I can for that.

BrettMoan commented 5 years ago

This one looks promising for the odbc side:

https://github.com/wankdanker/node-odbc/blob/master/README.md

ChrisTuckerNM commented 5 years ago

How is the pull request coming?

ChrisTuckerNM commented 5 years ago

Any movement on local repos for DB2?

mtxr commented 5 years ago

Didn't have time to work on it yet. But PRs are welcome, for someone with knowledge on DB2 would be basic add the driver, add the queries and some copy & paste from other dialects you could use as an example

mtxr commented 5 years ago

For those who want to work in this feature request, here is a guide of how to add a new dialect.

https://vscode-sqltools.mteixeira.dev/contributing/support-new-drivers

mtxr commented 4 years ago

@FireFighter1017 @ChrisTuckerNM DB2 support was developed and release by @EpicEric .

This issue covers many things and as we need specific queries for each RDBMS, I'll close it for now.

if you still need drivers to connect to CSV, Access and etc. it's better to open individual issues for each driver, and if possible write the queries regarding that driver to display tables, columns and functions.

All driver can use OBDC / JDBC behind it, but it needs to be individually written.

Closing.

AmbrosiaDevelopments commented 4 years ago

Where was it released? His fork is behind yours and I can't find where you've done a PR for it.

mtxr commented 4 years ago

It was release a few weeks ago. It's part of SQLTools extension. Just install version v0.21.2 and you should be able to see it in the connection assistant

image

EpicEric commented 4 years ago

It wasn't me that added DB2 support, it was @snyang :sweat_smile:

The PR is #391

AmbrosiaDevelopments commented 4 years ago

Thank you

mtxr commented 4 years ago

It wasn't me that added DB2 support, it was @snyang

The PR is #391

Lol. That's true. Thanks @EpicEric and @snyang

a019647 commented 3 years ago

It's sad that this was never supported. JDBC and ODBC are highly useful and utilized ways to connect to databases generically without the need to customize the client. It sounds like you've got a tight coupling between the dialect and the driver as a whole. This isn't normal or necessary. Products like Hibernate allow you to connect to any JDBC source generically. Since Hibernate uses canned query approaches, it also has need of a dialect definition, but does not couple this to the driver API in any way. Dialects are specified independently. In addition, Hibernate defines more generic dialects that can often be used across multiple databases for which no specific dialects have yet been defined.

shrikantkulkarni23 commented 3 years ago

@mtxr - any plans supporting odbc driver for redshift?

rubensa commented 3 years ago

Couldn't be developed a generic JDBC driver implemented with node-jdbc?
This would allow connecting with any database that has a JDBC driver (despite you have Java installed and available in the PATH) without having to implement an specific SQLTools driver for that database.

denladdi commented 8 months ago

It was release a few weeks ago. It's part of SQLTools extension. Just install version v0.21.2 and you should be able to see it in the connection assistant

image

I can't find that driver in the extensions-browser :-(

gjsjohnmurray commented 8 months ago

@denladdi this driver is no longer available. Please see https://github.com/mtxr/vscode-sqltools/issues/454#issuecomment-678024106 and subsequent comments.

denladdi commented 8 months ago

@denladdi this driver is no longer available. Please see #454 (comment) and subsequent comments.

gotcha.. sadly nothing new there.. hoped I could switch from SQL Workbench (JS), HeidiSQL, DreamWeaver and various other SQL/coding tools to just using vs code :-(

Hope this evolves somewhen.