Giter Site home page Giter Site logo

bajdzis / vscode-database Goto Github PK

View Code? Open in Web Editor NEW
145.0 145.0 82.0 2.49 MB

Extension for Visual Studio Code

Home Page: https://marketplace.visualstudio.com/items?itemName=bajdzis.vscode-database

License: MIT License

JavaScript 9.00% CSS 1.95% HTML 6.98% TypeScript 82.08%
database mysql postgres vscode-extension

vscode-database's People

Contributors

artemiusua avatar bajdzis avatar brooksgarrett avatar epmatt avatar kasecato avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vscode-database's Issues

Port Nos. other than 3306

I need to change the port No. Typing "127.0.0.1:3307" doesn't solve the issue. Results in "MySQL Error: Error: getaddrinfo ENOTFOUND 127.0.0.1:3307 127.0.0.1:3307:3306".

MySQL Error: Error: Cannot enqueue Query after fatal error.

  • Extension Name: vscode-database
  • Extension Version: 1.5.0
  • OS Version: Darwin x64 17.4.0
  • VSCode version: 1.20.1
{
	"activationTimes": {
		"startup": true,
		"codeLoadingTime": 52,
		"activateCallTime": 16,
		"activateResolvedTime": 0,
		"activationEvent": "*"
	},
	"runtimeErrors": [
		{
			"name": "ReferenceError",
			"message": "_this is not defined"
		},
		{
			"name": "ReferenceError",
			"message": "_this is not defined"
		}
	]
}

My postgress.app database is not shown as an option

Summary

I'm unable to switch to my postgress.app database with the SQL: Select database command and I need to use the longer, multi-step command, SQL: Connect to postgreSQL server.

Details

When I issue the command SQL: Select database my postgress.app database is not shown in the auto-complete list.

However, when I issue SQL: Connect to postgreSQL server and use my postgress.app database, I get no errors and I'm able to query from the tables in that database. This is an OK workaround if I only want to use my postgress.app database. But, if I use the SQL: Select database to switch to a different database, I cannot easily switch back.

Offer Features : SQL Named Params

Offer support when you run a SQL query using a named parameter to the request.

  1. For named parameters to support the definition via RegExp pattern. At least support the 2 most popular formats:
    1.1. JetBrains style: :paramName
    1.2. Jinja style: {{ paramName }}

  2. When you run the query, display the form to fill the parameters. As an example, can offer a window fill the parameters of DBeaver:
    image

  3. To cache the previously set query parameters for a specific file, or query.
    3.1. For file to use file path relative to the root of the project
    3.2. For a selected query, you can use caching parameters the vector composed of the composition parameters in the query. For example, if the selected query parameters occur in the following order: param1, param3, param2. The vector for caching should be param1>param3>param2. If you add the reuse parameter: param1, param3, param2, param1, then the vector will be param1>param3>param2>param1

SQL EXAMPLES

For JetBrains

SELECT
    *
FROM
    project
WHERE
    id = :id

For Jinja

SELECT
    *
FROM
    project
WHERE
    id = {{ id }}

PS: IMHO, I consider it unwise to use logic and nested templates to construct the SQL on offer in Jinja. Named parameters, you can implement an overwhelming number of tasks, and the extra logic only complicates understanding SQL query.

Failed to execute CREATE PROCEDURE

Hi,

I get the following error message when i try to execute this SQL to create a Store Procedure on MariaDB. (I have commented the delimiter before executing it)

Error:
ER_PARSE_ERROR: You have an error in your SQL syntax;

SQL:

-- DELIMITER //
 
DROP PROCEDURE IF EXISTS GetAllPhoneBook;
CREATE PROCEDURE GetAllPhoneBook()
BEGIN
 DECLARE EXIT HANDLER FOR SQLEXCEPTION
 BEGIN
  ROLLBACK;
  SELECT 'An error has occurred, operation rollbacked and the stored procedure was terminated';
 END;
 
 START TRANSACTION;
 SELECT * FROM phone_book;
 COMMIT;
END;
-- //

-- DELIMITER ;

Get exception when querying describe [table_name]

This extension is awesome. I very like it. Thanks for the authors.

But I have some little issues:

  1. When I try to get description of table by the query
    DESCRIBE table_name.
    The console log error here:
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:10 MySQL Error: Error: Cannot enqueue Query after fatal error.
	at Protocol._validateEnqueue (C:\Users\vuongbq\.vscode\extensions\bajdzis.vscode-database-1.2.0\node_modules\mysql\lib\protocol\Protocol.js:199:16)
	at Protocol._enqueue (C:\Users\vuongbq\.vscode\extensions\bajdzis.vscode-database-1.2.0\node_modules\mysql\lib\protocol\Protocol.js:135:13)
	at Connection.query (C:\Users\vuongbq\.vscode\extensions\bajdzis.vscode-database-1.2.0\node_modules\mysql\lib\Connection.js:208:25)
	at Promise (C:\Users\vuongbq\.vscode\extensions\bajdzis.vscode-database-1.2.0\extension\engine\mysql.js:71:29)
	at Promise (<anonymous>)
	at MySQLType.queryPromise (C:\Users\vuongbq\.vscode\extensions\bajdzis.vscode-database-1.2.0\extension\engine\mysql.js:70:16)
	at sqlMulti.split.forEach.sql (C:\Users\vuongbq\.vscode\extensions\bajdzis.vscode-database-1.2.0\extension\engine\AbstractServer.js:57:35)
	at Array.forEach (native)
	at MySQLType.queryPromiseMulti (C:\Users\vuongbq\.vscode\extensions\bajdzis.vscode-database-1.2.0\extension\engine\AbstractServer.js:51:29)
	at Menager.queryPromiseMulti (C:\Users\vuongbq\.vscode\extensions\bajdzis.vscode-database-1.2.0\extension\Menager.js:91:39)
	at execQuery (C:\Users\vuongbq\.vscode\extensions\bajdzis.vscode-database-1.2.0\extension.js:67:13)
	at getBuildQueryDocument.then (C:\Users\vuongbq\.vscode\extensions\bajdzis.vscode-database-1.2.0\extension.js:58:9)
	at <anonymous>
  1. I couldn't change the database after the first error occurred.

Log here:

shell.ts:459 MySQL Error: Error: Cannot enqueue Query after fatal error.
	at Protocol._validateEnqueue (C:\Users\vuongbq\.vscode\extensions\bajdzis.vscode-database-1.2.0\node_modules\mysql\lib\protocol\Protocol.js:199:16)
	at Protocol._enqueue (C:\Users\vuongbq\.vscode\extensions\bajdzis.vscode-database-1.2.0\node_modules\mysql\lib\protocol\Protocol.js:135:13)
	at Connection.query (C:\Users\vuongbq\.vscode\extensions\bajdzis.vscode-database-1.2.0\node_modules\mysql\lib\Connection.js:208:25)
	at Promise (C:\Users\vuongbq\.vscode\extensions\bajdzis.vscode-database-1.2.0\extension\engine\mysql.js:71:29)
	at Promise (<anonymous>)
	at MySQLType.queryPromise (C:\Users\vuongbq\.vscode\extensions\bajdzis.vscode-database-1.2.0\extension\engine\mysql.js:70:16)
	at Promise (C:\Users\vuongbq\.vscode\extensions\bajdzis.vscode-database-1.2.0\extension\engine\mysql.js:86:18)
	at Promise (<anonymous>)
	at MySQLType.getDatabase (C:\Users\vuongbq\.vscode\extensions\bajdzis.vscode-database-1.2.0\extension\engine\mysql.js:85:16)
	at Menager.getDatabase (C:\Users\vuongbq\.vscode\extensions\bajdzis.vscode-database-1.2.0\extension\Menager.js:96:35)
	at changeDB (C:\Users\vuongbq\.vscode\extensions\bajdzis.vscode-database-1.2.0\extension.js:214:17)
	at e.$executeContributedCommand (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:4:412039)
	at t.e.invoke (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:4:509277)
	at e._invokeHandler (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:4:354645)
	at e._receiveOneMessage (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:4:354335)
	at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:4:353362
	at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:4:355281
	at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:4:85085
	at e.invoke (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:4:84368)
	at e.fire (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:4:86090)
	at Socket.<anonymous> (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:4:144000)
	at emitOne (events.js:96:13)
	at Socket.emit (events.js:191:7)
	at readableAddChunk (_stream_readable.js:178:18)
	at Socket.Readable.push (_stream_readable.js:136:10)
	at Pipe.onread (net.js:560:20)

Hope to get the answer. Thanks!

Query Advanced Build is compiling too frequently

When I'm using the temp.sql file to type in commands, I'm getting errors continuously as I'm typing. Could you make it so that it doesn't try to execute until you hit enter or something like that? It makes that WONDERFUL feature (ooh all that nice intellisense) nearly impossible to use.

``relation doesn't exist error`` postgreSQL -- yes it does!

Extension can see my database, connect, even see the tables. But when I make a query, I get a relation doesn't exist error.

image

FYI, the tables are in a named schema in db, not on public.

i.e. I'm connecting to myDB.myschema not just myDB...

Postgresql connection SSL enabled

How do I indicate ssl mode is required? I provide URL and port, user, pass, database, but there is no option to say ssl enabled. How do I do that?

'Database "โ€ฆ" does not exist' error message does not uniquely identify connection

The actual error message when starting VS Code is in this format:

PostgreSQL Error: error: database "[name of database connection property]" does not exist at [stack trace]

Since I've got two connections (local and remote) defined with the same database name in my configuration I can't know from this message which connection failed. If you could include the connection name and/or host in the message it would be possible to identify the failing connection.

commands not found on OSX

Hi Devs,

Not sure if the issue is on my end or not. I have tried to install the the plugin. When I tried to connect to my Postgres DB I got the following error:

command 'extension.connectPostgreSQL' not found

I also get similar errors for other commands.

Environment:
OS: OSX Sierra 10.12.1
VSCode: 1.7.1

Let me know if you need more details

feature: using ssh tunnel to connect to mysql

Hi,
In a tool like mysql workbench, you have several way to connect to a database:

  • hostname like now
  • local socket
  • ssh tunnel

would be really cool, if you can provide it.

Extra no using a reimplementation of the ssh client but using the one provided by the system.

CTRL+ENTER on Git sidebar creates temp.sql

Hello.

If I press CTRL+ENTER on the Git sidebar screen, with vscode-database extension enabled, it creates a temp.sql file.

Is that an issue/bug? if it is, please fix it, or enable a way to fix the keyboard shortcut.

Thanks a lot

Postgres table names should not require quotes

I have the vscode-database extension setup with a connection to my Postgres database. I want to run this simple query to get a count of the users in my system:

select count(*) from users

However, this valid query does not work as expected. The output window won't pop up, but I can manually open up the output window and see that the output was just the query that I executed. Moreover, I get the following output from the DB instance itself (the long query that this extension runs is omitted intentionally):

ERROR:  function to_regclass(information_schema.sql_identifier) does not exist at character 730
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
STATEMENT:  
SELECT...

Once I wrap my query with quotes, the behaviour works as expected:

select count(*) from "users"

Based on official Postgres documentation, quotes around a table name is not required. Therefore, this extension should not be enforcing this unnecessary requirement. It should instead be flexible to handle both quotes and unquoted table names.

This issue causes pain whenever I need to copy and paste long queries (for example, from source code, from my company's customer support team) for debugging, and I now need to manually wrap all table names with quotes.

Clicking outside VSCode...`

Clicking out of VSCode when you are setting up a new database connection causes the prompt to switch. I.e., I have a long AWS connection string that I wish to use and I don't want to type it all out, so I'm copying it - but when I click outside of the window it changes from 'localhost' (where it's asking for the sever name) to 'postgres' (where it's asking for the database name).

So, there's no way to copy/paste db info in via the interface.

No time stamps on logs

SQL logs need time stamps

  • SQL: Query Advancer Build
select * from foo;
select * from bar;
select * from baz;
  • [before] OUTPUT - database
select * from foo;
select * from bar;
select * from baz;
  • [after] OUTPUT - database
[10/Oct/2016:14:40:44.200 +0900] [SQL] select * from foo;
[10/Oct/2016:14:40:44.210 +0900] [SQL] select * from bar;
[10/Oct/2016:14:40:44.300 +0900] [SQL] select * from baz;

[Feature Request] Execute inline queries

Feature Request

Would it be possible to automatically execute single or multi-line queries? The user process I had in mind was:

  1. highlight text to execute
  2. press reserved key bind command (maybe alt + shift + ENTER)
  3. execute SQL: Query command and pass the highlighted text as a parameter

I don't know anything about vscode extensions, but I could try it out. Would this feature be possible at all? Does anyone know of another extension that takes input from highlighted text?

How can I see results inside the query file instead of OUTPUT console

I want to know how can I see the results inside a file, as in your gif. Right now I can see them just in the console, but looks weird

`SELECT * FROM accounts

ROW : 0

+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| id | 1 |
+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| created_at | Thu May 24 2018 18:58:21 GMT+0300 (EEST) |
+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| updated_at | Thu May 24 2018 18:58:21 GMT+0300 (EEST) |
+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| deleted_at | null |
+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| email | dsad |
+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| password | $2a$10$l5LiQ2IyoY5bwTnWlTCAE.Rp.zojYWGEnYOHgTmpF3ppJqOmF1kmK |
+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| role | admin |
+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| token | 682e7084032f81f99ecf4b3894555f41 |
+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

ROW : 1

+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| id | 2 |
+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| created_at | Thu May 24 2018 18:58:34 GMT+0300 (EEST) |
+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| updated_at | Thu May 24 2018 18:58:34 GMT+0300 (EEST) |
+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| deleted_at | null |
+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| email | dsad |
+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| password | $2a$10$4kNOv2TDSHPH8LIh2oGcy.P45lKCc/i2zcFkx5PgncMI2ism4mw3O |
+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| role | admin |
+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| token | 7c64845b975b754f538d50506664da53 |
+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

ROW : 2

+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| id | 3 |
+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| created_at | Fri May 25 2018 10:20:28 GMT+0300 (EEST) |
+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| updated_at | Fri May 25 2018 10:20:28 GMT+0300 (EEST) |
+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| deleted_at | null |
+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| email | dsad |
+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| password | $2a$10$XqoDqZvfDtVlZHvQPebsXObdD6YRhXIKz0yEUPHs423nmK3jsEACy |
+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| role | admin |
+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| token | d340c550d696051364f4f2a9110672f2 |
+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

ROW : 3

+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| id | 4 |
+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| created_at | Fri May 25 2018 10:21:33 GMT+0300 (EEST) |
+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| updated_at | Fri May 25 2018 10:21:33 GMT+0300 (EEST) |
+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| deleted_at | null |
+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| email | dsad |
+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| password | $2a$10$O1NPl68shP3i56EvcOUM8Oe61qKqgeHXb/nVMPofzqKqbxg8IT60m |
+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| role | admin |
+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| token | 4fefbc4bbba414051b1a8a509e38fade |
+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
`
It is happen on both dialects mysql and postgres for tables with multiple columns. I saw that for tables with less than 3-4 columns it's render correctly the output.

I think it's important to know that I'm using a laptop with 13" display.

Semicolons in strings cause error (Postgres)

Even a simple query like this:

select ';';

will fail with the following error:

PostgreSQL Error: error: unterminated quoted string at or near "'"
at Connection.parseE(/Users/keith/.vscode/extensions/bajdzis.vscode-database-1.5.2/node_modules/pg/lib/connection.js:567:11)
at Connection.parseMessage (/Users/keith/.vscode/extensions/bajdzis.vscode-database-1.5.2/node_modules/pg/lib/connection.js:391:17)
at Socket.<anonymous> (/Users/keith/.vscode/extensions/bajdzis.vscode-database-1.5.2/node_modules/pg/lib/connection.js:129:22)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at addChunk (_stream_readable.js:263:12)
at readableAddChunk (_stream_readable.js:250:11)
at Socket.Readable.push (_stream_readable.js:208:10)
at TCP.onread (net.js:594:20)

I tried this query with node-postgres and it worked fine, so I'm not sure what's happening here.

Can't create new connection

I click on the "Server not selected". I choose new connection. I select PostgreSQL. It isn't on localhost. When I paste in the URI, it already filled it out and is asking for the database.

I created a default for my localhost, but couldn't get that to work either. Is there a way to edit a connection?

Is there a way I can get a form or add a database connection manually?

disregard the commented code

Hey, thanks for your hard work. I am very happy with this extension.

As a suggestion, it would be great if the extension will disregard comment code.
For instance, if I try to run

-- select count(id) from users; 
select * from users; 

I will get a syntax error. Same thing if the comment is in this fomat: /* select count(id) from users; */

I also tried to select what I want to be executed before doing so with no success.

Thanks!

Sergio

save database - please ask for save with password

when i use the command `SQL: Save current server...", a file is created with my password.
I do not want to store my password in a local, unprotected, file.

I wish the extension would ask "Do you want to include your password in plain text in the config file?"

Socket

There's any possible that I connect via socket?

Remember Password and Username

I have to connect manually each time when I open VS Code. Is there any way to connect automatically when I open VS Code every time without entering username and password as host port number.
Thank You

Can't paste password

Like many people, I access many databases and use a password manager to store long, arbitrarily complex passwords that are difficult to remember.

The password prompt does not allow pasting passwords. Why?

Structure provider improvements

Hi guys!
I'm very appreciate your extension.
On structure provider: is it really good idea to select all rows from table on click without any limit?
It is a little bit annoying if a table is huge. Would it be better to add some default limit e.g. 50 top rows that can be changed in settings and some text on this in output?
Also it would be helpful to show table's structure in a tree form in structure provider to explore fields/indexes.
I can take over this and send PR.
What do you think?

Randomly adds empty last.sql and temp.sql files to projects not even using sql

  • VSCode Version: Code 1.11.2 (6eaebe3b9c70406d67c97779468c324a7a95db0e, 2017-04-13T08:01:14.464Z)
  • OS Version: Linux x64 4.4.0-53-generic
  • Extensions:
Extension Author Version
vscode-database bajdzis 1.2.0
vshaxe nadako 1.5.0

vscode tempsql

Sometimes one, sometimes the other, sometimes both, sometimes none. Pretty sure it's related to this extension, given the name.

Save previous queries for reuse

line query executed should be saved so that it can be reused by select from a dropdown of recently used queries statements...

Casing issues when targeting postgres with IdentityContext

Really impressive tool. I'm still having some issues that you may not have encountered yet. Here's one of them:

I am getting a lot of relation [tablename] does not exist when connecting to or querying my database.
ASP.net COre IdentityContext defines table names with camel casing and so code first creates them that way in the database.
I can open up and interact with the identity database in DataGrip with no issues.
When I connect to the database via vscode-database (btw I'm on a mac FWIW and using .NET Core 1.1) I get a ton of errors because it seems to force all queries to lower case.

Here are some screenshots to better explain:

camel cased databases are not listed:
image

If I start again (connect to postgres server) and type in my database at the prompt then it's reading it but I get these errors for every table in the database:

image

after I close them all, the status bar indicates I am connected to that database anyway:

image

here is that database in datagrip and I have no problems with interacting (tehre's no data yet so that's why the results are empty)

image

PostgreSQL Error: error: unterminated dollar-quoted string at or near "$$

always error when creating a function LANGUAGE plpgsql;

image

create function _user.check_password (
  password text
) returns text as $$
begin
  if password !~ '^(?=.*(\w)).{8,}$' then
    raise exception 'Password of minimum length 8 characters';
  else
    return password;
  end if;
end;
$$ language plpgsql;

FR: SSL authentication (mysql)

Hi,
I would like to propose support for authenticating via ssl (corresponding to the following command line arguments of the mysql client: --ssl-ca --ssl-cert --ssl-key).

  • Martin

Advanced query stops working after the output window is closed

The Problem

Advanced query stops executing queries after the output window is closed

Environment

vscode-database 1.1.0
Ubuntu 14.04 (64bit)
VSCode 1.8.1
Postgres 9.6

How To Replicate

In a project where you have a previously saved connection

  1. launch advanced query (Ctrl+Alt+Q)
  2. Write a query, save it (or use Ctrl+Enter)
  3. Close the output window
  4. Close the query file
  5. launch advanced query (Ctrl+Alt+Q)
  6. Write a or modify (existing) query, save it (or use Ctrl+Enter)
  7. Query doesn't run

Notes

  1. Run query (Ctrl+Q) will work even though advanced query doesn't
  2. Most times if VSCode is closed with temp.sql left open advanced query wont execute queries when
    The project is reopened (despite Server changed and Database selected notifications)
  3. sometimes If < project folder > /.vscode/temp.sql is deleted and advanced query is relaunched, it works but other times if temp.sql is deleted you get an error message saying the file doesnt exist and asks to create it if you do, advanced query wont execute

Empty database.json created every time when opening a folder

Every time I open a folder with this plugin enabled it creates the .vscode folder (if it doesn't exist) and an empty ({}) database.json file inside it.

This is slightly annoying, especially since I prefer having no VSCode metadata inside my projects.

[Request] Add condition for, and/or change Command + Enter keybindings

Command + Enter is Insert Line Below natively on Visual Studio Code.

Since this extension's Command + Enter has no condition, it overwrites and disables the native keybinding, even if it is not .sql file.

Either or both changes below can be made to fix this. (Probably there are better solutions though. I'm not extension expert.)

  1. Add condition: editorLangId == 'SQL'
  2. Change to different keybinding

2 is becauseInsert Line Below is important and very powerful keybinding for VS Code and would want to have it when editing not only non-SQL files but also SQL files. Technically you can manually turn off/change this keybindings, but I would suggest changing the default keybinding from Command + Enter.

cannot connect to databases that have a dash in name

If you do
>SQL: Select database

and specify a database with name like example-dev or example-test, you get the following error:

MySQL Error: Error: ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-dev' at line 1

Cannot use SCRAM-SHA-256 authentication with PostgreSQL

The extension does not seem to work with SCRAM-SHA-256 authentication which comes with PostgreSQL 10. It will throw out error saying "connection reset". When I switch back to MD5 everything works fine, however it is less secure.

Disable active connections

Hi @Bajdzis , congratulations for this amazing extension!

Rafael, I wonder if is there a way to remove the active connections that was saved. Where are the settings used to be located on?

Best regards,
Dan

Query not showing results, possibly too many rows

Hello, nice extension, appreciate the work

I have a task that saves about 600 rows in a table, whenever I try to select all the rows with select * from table it doesnt show nothing

I tried limiting the number of rows and I could see 400 rows, past that it didnt work.

If it helps, this table has 6 fields

Cheers

Edit: Was debuging this extension and got the message "Output omitted for a large object that exceeds the limits"

Anyone knows how to deal with this ? I dont care if the output is too big

Edit2: Found out in the vscode source that it has a const of MAX_LENGTH for these kind of inputs and the value is 100000. What I was trying to do debugging/testing was to create a new untitled file and paste the results in the editor

This is the code I used

var doc = vscode.window.activeTextEditor.edit(e => {
e.insert(new vscode.Position(0, 0), msg);
});

it's nothing fancy and I'm sure that somebody more skilled would know how to open a new texteditor and then put the message in. Could be a fix

Another fix I tried was splitting the output into pieces of MAX_LENGTH size then appending them in the outputchannel. It worked but I had to change the "scrollback" to something like 9999999999 to be able to scroll and see the result in the output channel.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.