1.打开VS Code拓展,搜索postgresql,这时就可以看到在线的支持postgresql的插件,这里我选择的第一个插件(下载量最多的);


2.安装postgresql插件,安装完成之后,在左侧就可以看到插件图标;

3.点击插件,输入连接地址、用户、密码、端口等建立数据库连接(本地已经创建连接,点击 + 添加新的连接);









3.连接上以后测试数据及结果如下:
create table test (id int primary key, name varchar, create_date timestamp );
select * from test;
insert into test values (1, '001', now());
insert into test values (2, '002', now());
select * from test;

4.Mysql也是类似,详情可参考:Vscode上使用SQL
文章来源:脚本之家
来源地址:https://www.jb51.net/article/204596.htm
申请创业报道,分享创业好点子。点击此处,共同探讨创业新机遇!