GithubHelp home page GithubHelp logo

microsoft / vscode-postgresql Goto Github PK

View Code? Open in Web Editor NEW
387.0 44.0 48.0 716 KB

PostgreSQL extension for VSCODE

License: Other

JavaScript 4.53% PowerShell 0.03% TypeScript 92.06% CSS 2.37% HTML 0.72% EJS 0.27% TSQL 0.01%

vscode-postgresql's Introduction

PostgreSQL for Visual Studio Code

Welcome to PostgreSQL for Visual Studio Code! An extension for developing PostgreSQL with functionalities including:

  • Connect to PostgreSQL instances
  • Manage connection profiles
  • Connect to a different Postgres instance or database in each tab
  • View object DDL with 'Go to Definition' and 'Peek Definition'
  • Write queries with IntelliSense
  • Run queries and save results as JSON, csv, or Excel

Install link: https://marketplace.visualstudio.com/items?itemName=ms-ossdata.vscode-postgresql

Quickstart

  1. Open the Command Palette (Ctrl + Shift + P).

  2. Search and select 'PostgreSQL: New Query'

  3. In the command palette, select 'Create Connection Profile'. Follow the prompts to enter your Postgres instance's hostname, database, username, and password.

You are now connected to your Postgres database. You can confirm this via the Status Bar (the ribbon at the bottom of the VS Code window). It will show your connected hostname, database, and user.

  1. You can type a query like 'SELECT * FROM pg_stat_activity';

  2. Right-click, select 'Execute Query' and the results will show in a new window.

You can save the query results to JSON, csv or Excel.

Offline Installation

The extension will download and install a required PostgreSQL Tools Service package during activation. For machines with no Internet access, you can still use the extension by choosing the Install from VSIX... option in the Extension view and installing a bundled release from our Releases page. Each operating system has a .vsix file with the required service included. Pick the file for your OS, download and install to get started. We recommend you choose a full release and ignore any alpha or beta releases as these are our daily builds used in testing.

Support

Support for this extension is provided on our GitHub Issue Tracker. You can submit a bug report, a feature suggestion or participate in [discussions].

Contributing to the Extension

See the developer documentation for details on how to contribute to this extension.

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Privacy Statement

The Microsoft Enterprise and Developer Privacy Statement describes the privacy statement of this software.

License

This extension is licensed under the MIT License. Please see the third-party notices file for additional copyright notices and license terms applicable to portions of the software.

vscode-postgresql's People

Contributors

akamath46297 avatar danielpellon avatar microsoft-github-policy-service[bot] avatar microsoftopensource avatar msftgits avatar rachel-msft avatar ravindrakreddy 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  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

vscode-postgresql's Issues

Closed results view doesn't reopen on execution of query

  • PGSQL Extension Version: 1.1.0
  • VSCode Version: 1.33.0
  • OS Version: macOS Mojave 10.14.4

Steps to Reproduce:

  1. Create a new query
  2. Run that query, causing the result view to be displayed
  3. Close the result view
  4. Run the query again

The plugin's log displays the following, but the results view is not re-displayed.

[1:42:15 PM] Started query execution for document "untitled:Untitled-1"
[1:42:15 PM] Finished query execution for document "untitled:Untitled-1"

The only way to make it reappear is to create a new query.

Support for SSH Tunnels

  • PGSQL Extension Version: 0.1.0
  • VSCode Version: 1.32.3
  • OS Version: OSX 10.14

Feature Request: when setting up a new connection, have support for connecting via SSH tunnels. Often developers can access a database via a tunnel, and having built in support for launching that tunnel is extremely convenient.

Work around: define an SSH config/tunnel, and connect to it, before trying to establish the connection via VSCode.

DataGrip does SSH tunnel connections extremely well.

Intellisense doesn't support Window statement

  • PGSQL Extension Version: 0.2.0
  • VSCode Version: 1.33.0
  • OS Version: Arch linux

Steps to Reproduce:
A simple query like:

select rank() over last_action_rank as "last_action_rank",
                   ua.id
from user_action ua
where ua.user_id is not null
    and ua.action in ('upvote',
                      'downvote')
window last_action_rank as (partition by ua.playback_id,
                                                                           ua.user_id
                                                              order by ts desc)

Get wrongly formatted, and window is not marked as a keyword:
image

Check the docs for PSQL language definition: https://www.postgresql.org/docs/current/sql-select.html

Error query column in table with JSON/JSONB

  • PGSQL Extension Version: 0.1.0
  • VSCode Version: 1.32.3 (1.32.3)
  • OS Version: Mac OS 10.14.2

Steps to Reproduce:

  1. Connect to a postgres DB
  2. Run Select * on any table that has a JSON/JSONB type field
[10:15:32 AM]	Started executing query at Line 2
	
	Commands completed successfully 
	
	Unhandled exception while executing query: 'dict' object has no attribute 'encode' 
	
	Total execution time: 00:00:01.625

Thanks for the new plugin

Support for plpgsql pldebugger

IDE based debugging of plpgsql functions is only possible with a few selected IDEs at present. VSCode support for this would be a killer feature.

Unable to execute any query on Redshift

  • PGSQL Extension Version: 0.2.0
  • VSCode Version: 1.36
  • OS Version: Windows 10

Steps to Reproduce:

  1. Connect to Redshift using host, port, credentials and database
  2. execute any sql query ('SELECT 1')
  3. Query does not execute, receive error message

Started executing query at Line 1
cursors can only be used within the transaction that created them.
Total execution time: 00:00:00.037

image

Connection to Postgres different than localhost fails on MacOS

  • PGSQL Extension Version: 0.1.0
  • VSCode Version: 1.32.3
  • OS Version: MacOS Mojave 10.14.3
  • Same happens in Azure Data Studio 1.5.1

Steps to Reproduce:

  1. Create a connection different than localhost using hostname:port\dbname
  2. Error: PostgreSQL: Failed to connect: could not translate host name "HOSTNAME:PORT\DBNAME" to address: nodename nor servname provided, or not known

I don't even get what it means, but in my other client (Postico) I can connect

I also attempted other combinations but no luck. I'd really appreciate some non-localhost example :)

Is this extension still supported?

Forgive the pointed title of the issue but I'd like to find a fix for #50. i'm happy to ask questions there about that issue but before that I'd like to understand if this extension is still supported.

Kind regards,

Setting application_name in pg_stat_activity

  • PGSQL Extension Version: 0.2.1
  • VSCode Version: 1.33.1
  • OS Version: Fedora 30

Steps to Reproduce:

  1. select * from pg_stat_activity

Hi All,

I saw a few related tickets on this but no final mentioning of what the state is but I am trying to identify AzureDataStudio as the application_name in pg_stat_activity. Is this feature supported?

Thank you,
Nik

user, password and dbname from settings.json is ignored

  • PGSQL Extension Version: 0.1.0
  • VSCode Version: Version 1.32.3 (1.32.3)
  • OS Version: macOS High Sierra 10.13.6 (17G5019)

Steps to Reproduce:

  1. settings.json
{
    "window.zoomLevel": -1,
    "pgsql.connections": [
        {
            "host": "localhost",
            "port": "54321",
            "dbname": "my_db",
            "user": "postgres",
            "password": "password",
            "emptyPasswordInput": false,
            "profileName": "My DB"
        }
    ]
}
  1. Command Palette > PostgreSQL: New Query
  2. Select Connection Profile

I am asked to enter the username and then the password (although both is specified in settings.json)

When I try to run a query, I get an error saying that relation "mytable" does not exist.

I try to list the tables and it appears I am not connected to the correct database (even though the name is specified in settings.json as well).

Can't install

  • PGSQL Extension Version:
    11

  • VSCode Version:

  • OS Version:
    Mint 19 32-bit

Steps to Reproduce:

  1. Load from VSIX
  2. Ctrl - shift P; select Postgresql new query.
    Error: Unable to execute the command while the extension is [cannot read: presumably, 'loading'].

I tried to load it directly from VSC but got a message saying that the PS tools hadn't loaded.

Connection refused! Can't specify listening port number

PostgreSQL: Failed to connect: could not connect to server: Connection refused
Is the server running on host (10.1.1.122) and accepting
TCP/IP connections on port 5433?

VSCode Version 1.32.3 (1.32.3)

Please allow for port specification. Not every server defaults to 5433/5432!

Perhaps allow {host}:{port} formatting option.

Failed to start extension

  • PGSQL Extension Version: 0.1.0
  • Azure Data Studio Version: 1.5.1
  • OS Version: Windows 10, Version 1703 (OS Build 15063.1631)

Steps to Reproduce:

  1. I have installed the extension
  2. After reload I have been notified with "Failed to start Pgsql tools service"

Cannot connect to PostgreSQL

  • PGSQL Extension Version: Latest(can't tell in Visual Studio code)
  • VSCode Version:
  • OS Version: Mac - OSX

Steps to Reproduce:

  1. I set the hostname to be "localhost"
  2. PostgreSQL user "postgres"
  3. I don't know what kind of password it expects
  4. Standard connection selected

Error received is "connect ECONNREFUSED 127.0.0.1:5432"
What's the required password to set a connection?

Copy/Paste with and without Headers does not work from Results view.

  • PGSQL Extension Version: 1.2.1
  • VSCode Version: 1.21.1
  • OS Version: Windows 10

Steps to Reproduce:

  1. Execute a select query.
  2. Select the results from the Results view.
  3. Copy and paste it in notepad

Expected

  1. Paste works

Actual

  1. Paste does not work.
  2. There is an unhandled exception thrown.

VS Code warning about deprecated command usage

  • PGSQL Extension Version: 0.1.0
  • VSCode Version: 1.32.3
  • OS Version: Windows 10 x64 Version 1803

Steps to Reproduce:

  1. Query a table via a configured connection
  2. A warning notification is raised in VS Code with the following text:
Extension 'ms-ossdata.vscode-postgresql' uses the 'vscode.previewHtml' command which is deprecated and will be removed soon. Please file an issue against this extension to update to use VS Code's webview API.

The webview API docs can be found here

keywordCasing not recognized in intellisense suggestions

  • PGSQL Extension Version: 0.2.0, pgtoolsservice 1.1.0
  • VSCode Version: 1.33.1
  • OS Version: Ubuntu 18.10

Steps to Reproduce:

  1. Set everything to lowercase just to be certain:
	"pgsql.format.datatypeCasing": "lowercase",
	"pgsql.intelliSense.lowerCaseSuggestions": true,
	"pgsql.format.keywordCasing": "lowercase",
  1. Either connect to a db or not, this does not seem to matter
  2. Type create to summon the intellisense suggestions box and see all uppercase

I can only find keywordCasing in the settings files, and not implemented in code anywhere. Is it a stub? And what makes this strange is that the keywords are all lower case in the plist file.

Please help, I like tabbed suggestions, but don't like my sql code to look like an angry old relative's email forward.

Running a query requires a begin/end block

  • PGSQL Extension Version: 0.2.0
  • VSCode Version: 1.35.1
  • OS Version: MacOs Mojave 10.14.5

Steps to Reproduce:

  1. Run query 'SELECT * FROM pg_stat_activity;';
  2. Result returns 'cursors can only be used within the transaction that created them. '
  3. Run query BEGIN; SELECT * FROM pg_stat_activity; END;
  4. Query returns the result correctly

Is this the supposed to happen?

Error: command 'vscode.previewHtml' not found - MacOS

  • PGSQL Extension Version: 0.1.0
  • VSCode Version: Version 1.33.0 (1.33.0)
  • OS Version: macos 10.14.4

Steps to Reproduce:

  1. Install extension
  2. shift-command P, new query
  3. provide localhost, database name, user, password
  4. write simple query
  5. execute query

This was working fine until I updated MacOS. Now this extension and VSCode do not work at all. Any attempt to run a query results in the terminal error message Error: command 'vscode.previewHtml' not found and nothing else. No query is ever run.

Looking in the logs, it is clear the extension does run:

10:24:31 AM] Started query execution for document "untitled:Untitled-1"
[10:24:31 AM] Finished query execution for document "untitled:Untitled-1"

However no data is retrieved or displayed.

JSON column output isn't valid JSON

  • PGSQL Extension Version: 0.1.0
  • VSCode Version: 1.32.3
  • OS Version: macOS 10.12.6

Steps to Reproduce:

  1. Write any query
  2. Prefix it with EXPLAIN (ANALYZE, COSTS, VERBOSE, BUFFERS, FORMAT JSON)
  3. Copy column to clipboard and paste on https://tatiyants.com/pev/#/plans/new
  4. JSON is invalid as it's shown in the output with single quotes instead of double

Feature Request: Enhance Formatting with Rules

  • PGSQL Extension Version: 0.2.0
  • VSCode Version: 1.36.1
  • OS Version: Debian 10 (Buster)

The postgress DDL language formatters that are widely used are all self proclaimed "oppinionated" formatters:

  1. https://news.ycombinator.com/item?id=18087514
  2. https://news.ycombinator.com/item?id=18184731
  3. https://github.com/benjie/prettier-plugin-pg/issues

Not many formatters offer a way to specify subtle things like:

  • Multi-line statements formatting preference
  • Indent depth for embedded or nested statements
  • Capitalization preference for keywords

As you can see from the Hacker News conversations, developers are frustrated with the lack of flexibility with the formatters and by the lack of support from the Postgres team for any official parser. Microsoft is in the unique position to solve this developer problem by working with the Postgres team to produce the defacto formatter for Postgres. Perhaps, it could even work with MSSQL Server and MySQL/MariaDB.

Thank you for accepting my feature request.

First Use Hangs

  • PGSQL Extension Version: 0.2.0
  • VSCode Version: 1.3.3.0
  • OS Version: MacOS 10.14.4

Steps to Reproduce:

  1. Shift+CTRL P
  2. Select New Query

Result is a message that the extension is unavailable till it loads. Repeat, extension then works.

Error: command 'vscode.previewHtml' not found

  • PGSQL Extension Version: 0.1.0
  • VSCode Version: 1.33.0
  • OS Version: windows 7

Steps to Reproduce:

  1. type a select statement: select count(*) from connection.table
  2. get error message: "Error: command 'vscode.previewHtml' not found"

Extension stops working after a while

  • PGSQL Extension Version: 0.2.0
  • VSCode Version: 1.33.0
  • OS Version: Arch Linux

Steps to Reproduce:

  1. Run queries for a while

After running queries for a while, the extension stops working and the only way to make it work again is by restarting the IDE.

The error is:

PostgreSQL: Execution failed: Another query is currently executing.

_this._Promise is not a constructor

  • PGSQL Extension Version: 1.1.11
  • VSCode Version: 1.41.1
  • OS Version: Windows 10

Steps to Reproduce:

I upgraded my VSCode and since then I can't connect to my database anymore.

Here is the error message I receive: _this._Promise is not a constructor

I would also like to point out that it's not coming from my database, because I can connect using other VSCode extensions.

Best regards

Can't Add extension in Mac

  • PGSQL Extension Version:0.1.0
  • VSCode Version: ADS 1.5.1
  • OS Version: MacOSMojave 10.14.3

Steps to Reproduce:

  1. I don't see PostGreSQL as extension when I search but from VS code extension, I downloaded vscode-postgresql-0.1.0-osx.vsix package and installed but when I reload, I get error

ADS Extension

Error

Successfully Installed and working on OS Version: MacOSMojave 10.14.2

org.freedesktop.secrets: No such file or directory

Hi!
Im trying to connect to a PostgreSQL on a LUNUX Ubuntu 18.04 and it's promting the follow message.

Erro ao chamar StartServiceByName para org.freedesktop.secrets: GDBus.Error:org.freedesktop.DBus.Error.Spawn.ExecFailed: Failed to execute program org.freedesktop.secrets: No such file or directory

Intellisense not working

  • PGSQL Extension Version: 0.1.0
  • VSCode Version: 1.32.3
  • OS Version: macOS 10.14.4

In extension description one of the features listed is:

  • Write queries with Intellisense

However, I could not found a way to get Intellisense working.
Am I missing something?

Manjaro Linux: Platform is not supported

  • PGSQL Extension Version: 0.1.0
  • VSCode Version: 1.31.1
  • OS Version: Manjaro 18.0.3 Illyria - Kernel: x86_64 Linux 4.19.23-1-MANJARO

Steps to Reproduce:

  1. Install plugin
  2. Try to use any of the plugin commands

postgresql_vscode

How to set a schema name or search_path

I want to know where can I set the schema name. Of course I can write the schema name in each sentence. But in my organization we do not do that. We set the schema in a set search_path sentence and then write commands without writing the schema name explicitily.

I try:

  • PGSQL Extension Version: 0.2.0
  • VSCode Version: 1.39.2
  • OS Version: Windows 10

Steps to Reproduce:

  1. In postgresql (in pgAdmin4 or psql)
create database my_test_db;
create schema mtest;
set search_path = mtest;
create table the_table(
   my_field text
); -- it is created in mtest schema
insert into the_table values ('the value');
  1. In Visual Studio Code settings.json
    "pgsql.connections": [
        {
            "host": "localhost",
            "dbname": "my_test_db",
            "user": "postgres",
            "password": "",
            "emptyPasswordInput": false,
            "port": "5432",
            "profileName": "my-profile",
            "options": "search_path = mtest",
            "connectTimeout": 15,
            "encrypt": false,
            "applicationName": "vscode-pgsql",
            "hostaddr": "",
            "sslmode": "prefer",
            "clientEncoding": "",
            "sslcompression": true,
            "sslcert": "",
            "sslkey": "",
            "sslrootcert": "",
            "sslcrl": "",
            "requirepeer": ""
        }
    ]
  1. try to connect

I get:

PostgreSQL: Failed to connect: FATAL: argumentos de línea de órdenes no válidos para proceso servidor: search_path=mtest

I try with other "options" values. For example "schema=mtest", "schema:mtest", "search_path:mtest", etc.

Intellisense doesn't work

  • PGSQL Extension Version: 0.2.0
  • VSCode Version: 1.32.2
  • OS Version: macOS 10.15

Steps to Reproduce:

  1. Install extension
  2. open a .sql file or open New Query with command palet
  3. Write or modify a query

Suggestion works but no syntax error is raised.

Underlines a specific string ("pos:") for any file type

  • PGSQL Extension Version: 1.1.10
  • VSCode Version: 1.35.0
  • OS Version: Windows 10

Steps to Reproduce:
Type "pos:" in any file type (txt, php, js, etc) and the text turns into a link that is underlined. This causes an issue when trying to use ctrl+click to navigate to a property, VS Code throws and error: "Unable to open '': resource is not available." I pinpointed this to the PGSQL extension.

This also shows up anywhere you have "pos" followed by ":" without any special characters.

Capture1
Capture

Encoding error when result set contains non-ascii character

  • PGSQL Extension Version: 0.2.0
  • VSCode Version: 1.37.1
  • OS Version: Windows_NT x64 10.0.17763

Steps to Reproduce:

  1. Run a query in which the result set contains a non-ascii character. e.g. 'ä'
    The following query is enough to produce the error: select 'ä'
  2. Receive the following error:
	Started executing query at Line 1
	
	Commands completed successfully 
	
	Unhandled exception while executing query: 'ascii' codec can't encode character '\xe4' in position 8: ordinal not in range(128) 
	
	Total execution time: 00:00:00

Webview does not set a content security policy

Hi, I'm the developer of VS Code's webview API. I noticed that your extension seems to create a webview that does not set a content security policy. All webviews (even very simple ones) should set a content security policy. This helps limit the potential impact of content injections and is generally a good measure for defense in depth.

We've documented how to add a content security policy to VS Code webviews here. Please add the most restrictive content security policy possible to your webview. I am not aware of any immediate security issues with your extension but having a restrictive content security policy is important to help protect users of your extension.


Also note that in development mode, in VS Code 1.38 you should also see a warning if you create a webview that does not set a content security policy: microsoft/vscode#79248

why not to contribute to other extensions that already exists?

Hi,

Please, don't get me wrong, but we currently have lots of extensions providing database connections for many RDBMS like MySQL, PostgreSQL, SQL Server, Oracle..

Why not support and encourage the developers to keep with all those already kind of successful project instead of creating a new extension?

I one of those developers, and particularly I don't get the point of creating a new extension every time instead of contributing. I'm not talking about Microsoft only, but we have dozen of extensions being created every time.

I'm a really fan of VSCode, in fact I've already submitted PRs for docs and the core code, but I really don't get this point.

I'm just looking for an explanation, because I prefer to contribute to this project instead of keep trying to grow a project that would be probably forgotten just because here we have Microsoft's name. I just want a good tool to work with and I really don't mind to contribute, just want a direction.

Sincerely,
M.

Connection Management is Non-Existant

  • PGSQL Extension Version: 0.2.0
  • VSCode Version: 1.3.3.0
  • OS Version: MacOS 10.14.4

Steps to Reproduce:

  1. setup new extension connections

If you setup more than one connection, for example, one to a localhost, and one to an external host, you would think you'd see these connections as a choice to pick from. Instead, when you try and use a connection, nothing happens. No error messages. Just nothing.

Yet another sign this extension is far from prime-time, and is more of a lab experiment.

Result page not rendering

  • PGSQL Extension Version: 0.2.0
  • VSCode Version: 1.39.2
  • OS Version: Ubuntu Server 18.04

Steps to Reproduce:
Use remote extension to connect to a VPS

  1. Create Profile
  2. Run Query

image

Zero-length string ('') shows up as NULL in the results pane

  • PGSQL Extension Version: 0.1.0
  • VSCode Version: 1.5.1
  • OS Version: macOS Mojave 10.14

Steps to Reproduce:

CREATE TABLE t1 (c1 TEXT,
                 comment TEXT);

INSERT INTO t1 (c1, comment) VALUES (null, 'null value'),
                                    ('', 'zero-length string'),
                                    (' ', 'single-space string');
                                    
SELECT * FROM t1;

image

Note that other GUIs properly render this result as a zero-length string:

image

Problem with disrupted Postgres Connection. Unable to reconnect

Issue Type: Bug

When my laptop loses connection to the internet (like hibernate/wake), the connection is disrupted. When I try to run the query in this state it prompts me to reconnect, which I do. However, when I run the query again I see the error:

Execution failed due to an unexpected error: 
Another query is currently executing.
Total execution time: 00:00:00

I cannot re-establish the connection. Instead I have to close the query window and start a new one.

The only databases I use are Postgres, I don't know if this happens to other providers.

Azure Data Studio version: azuredatastudio 1.15.1 (83544eba2504f564d785534cc780d2073feec2cc, 2020-02-15T05:01:39.777Z)
OS version: Darwin x64 18.7.0

System Info
Item Value
CPUs Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz (12 x 2600)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off
surface_control: disabled_off
surface_synchronization: enabled_on
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) 2, 2, 2
Memory (System) 16.00GB (0.26GB free)
Process Argv
Screen Reader no
VM 0%
Extensions (1)
Extension Author (truncated) Version
azuredatastudio-postgresql Mic 0.2.4

Indentation of SQL files is excessive even without JSON queries

  • PGSQL Extension Version: 0.2.0
  • VSCode Version: 1.35.1
  • OS Version: Windows 10 version 1903 (OS Build 18362.175)

Steps to Reproduce:

  1. Paste in some PGSQL like this:
CREATE TABLE public.users
(
    id serial,
    login character varying(100) NOT NULL,
    displayname varchar(100) NOT NULL,
    password_hash character varying(255) NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    PRIMARY KEY (id),
    CONSTRAINT login UNIQUE (login)
)
WITH (
    OIDS = FALSE
);
  1. Save it as an .sql file, or tell VS Code it is a PGSQL file and do a format with SHIFT-ALT-F, and I end up with this:
CREATE TABLE public.users ( id serial, login character varying(100) NOT NULL,
                                                                    displayname varchar(100) NOT NULL,
                                                                                             password_hash character varying(255) NOT NULL,
                                                                                                                                  created_at timestamp with time zone NOT NULL,
                                                                                                                                                                      updated_at timestamp with time zone NOT NULL,
                                                                                                                                                                                                          PRIMARY KEY (id), CONSTRAINT login UNIQUE (login)) WITH ( OIDS = FALSE);

This is just some example SQL I got from pgAdmin. It seems to happen regardless of the SQL in question. It does not happen with this extension disabled (i.e. it is the only extension I currently have installed that offers a formatter for sql files).

Similar to #47 but not limited to JSON queries.

Formatting indents too much for JSON queries

  • PGSQL Extension Version: 0.2.0
  • VSCode Version: 1.34.0
  • OS Version: macOS Mojave 10.14.5 (18F203)

Steps to Reproduce:

  1. Run "PostgreSQL: New Query"

  2. Add the following content:

    SELECT a, b, c FROM table_name;
    SELECT jsonb->>'a', jsonb->>'b', jsonb->>'c' FROM table_name;
  3. Run "Format Document"

Result:

SELECT a,
       b,
       c
FROM table_name;


SELECT jsonb->>'a',
               jsonb->>'b',
                       jsonb->>'c'
FROM table_name;

I would prefer the formatting to align selections for JSON data consistently with other selections. e.g.:

SELECT a,
       b,
       c
FROM table_name;


SELECT jsonb->>'a',
       jsonb->>'b',
       jsonb->>'c'
FROM table_name;

Persist password in a persistent store

Users should be able to provide a consent to store the password in the persistent store which the connection manager would utilize for future connections

Result windows from queries won´t show up again after being closed

  • PGSQL Extension Version: 0.2.0
  • VSCode Version: 1.39.2
  • OS Version: Windows 10, Version 1903, OS build 18362.476

After executing a query from a file, the first time I open VS Code, I get the result window as I should. If I close the result window of that file, and try to run it again, I get no result window (and the query is still executed).

Steps to Reproduce:

  1. Execute a query in a file, and get the result window ( with a SELECT result, for example)
  2. Close said result window, run the command again, get no result window. Problem fixed by closing VS Code and opening it again

Ubuntu 18.04 build

Currently only (offline) builds for Ubuntu 14.04 and 16.04 are available. Would be great to have one for Ubuntu 18.04.

support for cockroach db

  • PGSQL Extension Version: 0.2.0
  • VSCode Version:1.33.1
  • OS Version:Ubuntu 18.04

Steps to Reproduce:

  1. add new connection profile
  2. execute simple query ("select 1")

expected :
returning query result

actual :
got error

Started executing query at Line 1
syntax error at or near "declare" 
Total execution time: 00:00:00.001

since cockroachDB use postgresql driver to connect, i think it should be possible

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.