You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[DuckDB SQL Tools](https://marketplace.visualstudio.com/items?itemName=RandomFractalsInc.duckdb-sql-tools) extension enables using [DuckDB](https://duckdb.org/)in [VSCode](https://code.visualstudio.com/) IDE with the popular [SQLTools](https://vscode-sqltools.mteixeira.dev/en/home/)VSCode extension and SQL query editing and processing tools.
9
+
[DuckDB SQL Tools](https://marketplace.visualstudio.com/items?itemName=RandomFractalsInc.duckdb-sql-tools) extension adds [DuckDB](https://duckdb.org/)support to [VSCode](https://code.visualstudio.com/) IDE, and provides database schema and SQL query API and user interfaces for the popular [SQLTools](https://vscode-sqltools.mteixeira.dev/en/home/) extension, SQL query editor, SQL language server, and data processing tools.
[DuckDB](https://duckdb.org/docs/) is an in-process SQL [OLAP](https://en.wikipedia.org/wiki/Online_analytical_processing) database management system that uses vecotrized data engine for optimized analytics and parallel query processing with extensive SQL support and direct `Parquet` and `CSV`querying capabilites.
15
+
[DuckDB](https://duckdb.org/docs/) is an in-process SQL [OLAP](https://en.wikipedia.org/wiki/Online_analytical_processing) database management system that uses vecotrized data engine for optimized analytics and parallel query processing with extensive SQL support and direct `Parquet` and `CSV`data loading and query capabilites for local and remote data files.
16
16
17
-
[DuckDB SQL Tools](https://marketplace.visualstudio.com/items?itemName=RandomFractalsInc.duckdb-sql-tools) extension adds the following capabilities to VSCode IDE to work with DuckDB instances:
17
+
[DuckDB SQL Tools](https://marketplace.visualstudio.com/items?itemName=RandomFractalsInc.duckdb-sql-tools) extension adds the following capabilities to VSCode IDE for working with DuckDB instances:
18
18
19
-
- Connect to a local DuckDB instance
20
-
- Create in-memory DuckDB instance
21
-
- View DuckDB tables, columns, and views
22
-
- Run SQL queries on open DuckDB instances
23
-
- Attach SQLite database files to in-memory DuckDB instances
24
-
- Query remote `CSV` and `Parquet` data files using [DuckDB HTTPFS](https://duckdb.org/docs/extensions/httpfs.html) extension and create in-memory DuckDB tables from remote data results
25
-
- Create named SQL query Bookmarks
26
-
- View SQL Query History
19
+
-**Connect** to a local DuckDB instance
20
+
-**Create** new in-memory DuckDB instance
21
+
-**View** DuckDB tables, columns, and views
22
+
-**Run** SQL queries on open DuckDB connections
23
+
-**Attach** SQLite database files to in-memory DuckDB instances
24
+
-**Query** remote `CSV` and `Parquet` data files with [DuckDB HTTPFS](https://duckdb.org/docs/extensions/httpfs.html) extension
25
+
-**Create** in-memory DuckDB tables from remote data sources and query results
26
+
-**Manage** DuckDB connections in SQLTools Database Explorer
27
+
-**Autocomplete** SQL keywords, table names, column names, and view names on open database connections in VSCode SQL editor
28
+
-**Save** named SQL query Bookmarks
29
+
-**Use** SQL Query History
30
+
-**Export** SQL query results in `CSV` and `JSON` data formats
27
31
28
32
See [SQLTools documentation](https://vscode-sqltools.mteixeira.dev/en/home/) for a comprehensive list of SQLTools extension features contributed to VSCode IDE.
29
33
@@ -39,9 +43,9 @@ Users of [VSCodium](https://vscodium.com/) and other VSCode-based IDEs can insta
39
43
40
44
# DuckDB Extensions
41
45
42
-
DuckDB egnine also provides a number of [Extensions](https://duckdb.org/docs/extensions/overview) you can install and load to work with remote `CSV` and `Parquet` data files over [HTTPFS](https://duckdb.org/docs/extensions/httpfs), enable [Full Text Search](https://duckdb.org/docs/extensions/full_text_search), attach SQLite database with [SQLite Scanner](https://duckdb.org/docs/extensions/sqlite_scanner), or attach Postgres database instance with [Postgres Scanner](https://duckdb.org/docs/extensions/postgres_scanner).
46
+
DuckDB egnine also provides a number of [Extensions](https://duckdb.org/docs/extensions/overview) you can install and load to work with remote `CSV` and `Parquet` data files over [HTTPFS](https://duckdb.org/docs/extensions/httpfs), enable [Full Text Search](https://duckdb.org/docs/extensions/full_text_search), attach [SQLite](https://sqlite.org/about.html) database with [SQLite Scanner](https://duckdb.org/docs/extensions/sqlite_scanner), or attach [PostgreSQL](https://www.postgresql.org/about/) database instance with DuckDB[Postgres Scanner](https://duckdb.org/docs/extensions/postgres_scanner).
43
47
44
-
You can check the list of core and installed DuckDB extensions by running the following SQL query on an open database instance:
48
+
You can check the list of core and installed DuckDB extensions by running the following SQL query on an open database connection:
45
49
46
50
```sql
47
51
select*from duckdb_extensions();
@@ -51,24 +55,28 @@ select * from duckdb_extensions();
51
55
52
56
## DuckDB HTTPFS
53
57
54
-
DuckDB SQL Tools VSCode extension installs and loads [HTTPFS](https://duckdb.org/docs/extensions/httpfs) DuckDB extension by default for all the open DuckDB instances. You can add other [DuckDB Extensions](https://duckdb.org/docs/extensions/overview) to an open database instance by using[`INSTALL` and `LOAD`](https://duckdb.org/docs/extensions/overview#remote-installation) extension SQL statements.
58
+
DuckDB SQL Tools VSCode extension installs and loads [HTTPFS](https://duckdb.org/docs/extensions/httpfs) DuckDB extension by default for all the open database instances. You can add other [DuckDB Extensions](https://duckdb.org/docs/extensions/overview) to an open database instance by running[`INSTALL` and `LOAD`](https://duckdb.org/docs/extensions/overview#remote-installation) extension SQL statements.
55
59
56
-
Bellow is an example of loading reported Chicago crimes data into in-memory DuckDB instance from a `.parquet` data file hosted in our [Chicago Crimes](https://github.com/RandomFractals/chicago-crimes) data and analytical tools demo Github repository. This example uses implicitly loaded DuckDB HTTPFS extension to query reported Chicago crimes parquet data file with over 210K recorded crime reports, creates a `CrimeReports` table in DuckDB `:memory:` instance from loaded parquet data results, and queries imported data:
60
+
Example of loading trimmed down Chicago crimes data reported in 2022 into an in-memory DuckDB instance from a `.parquet` data file hosted in our [Chicago Crimes](https://github.com/RandomFractals/chicago-crimes) data and analytical tools demo Github repository:
This example uses implicitly loaded DuckDB HTTPFS extension to query reported Chicago crimes parquet data file with over 210K recorded crime reports, creates a `CrimeReports` table in a new DuckDB `:memory:` instance from remote parquet data file, and queries imported data.
65
+
60
66
## DuckDB SQLite Scanner
61
67
62
-
Use the following SQL statements to add [SQLite Scanner](https://duckdb.org/docs/extensions/sqlite_scanner) extension to in-memory DuckDB instance:
68
+
[SQLite](https://sqlite.org/about.html) database users can use DuckDB SQL Tools VSCode extension and DuckDB [SQLite Scanner](https://duckdb.org/docs/extensions/sqlite_scanner) extension to add data from SQLite database to in-memory DuckDB instance.
69
+
70
+
Run the following SQL statements to add SQLite Scanner DuckDB extension to an open database connection:
63
71
64
72
```sql
65
73
INSTALL sqlite;
66
74
LOAD sqlite;
67
75
```
68
76
69
-
With the loaded SQLite Scanner extension you can attach SQLite database to DuckDB database instance. Attached SQLite database tables will show up as views in DuckDB instance.
77
+
With the loaded SQLite Scanner DuckDB extension you can attach SQLite database file to a DuckDB database instance. Attached SQLite database tables will show up as views in DuckDB instance.
70
78
71
-
Use the following SQL `CALL` function to attach SQLite database instance:
79
+
Run the following SQL `CALL` function to attach SQLite database instance:
**Note**: DuckDB SQL Tools extension uses [DuckDB NodeJS Client API](https://duckdb.org/docs/api/nodejs/overview). In order to work with local data files, you need to specify full path to your local database or data files in SQL statements that reference local file paths.
82
90
83
-
Future versions of this extension might simplify local file path references by deducing absolute file path form the local DuckDB file connection string or open VSCode project workspace URI and replace relatIve database or data file references with the corresponding absolute path in an open VSCode project Workspace.
91
+
Future versions of this extension might simplify local file path references by deducing absolute file path from the local DuckDB file connection string or open VSCode project workspace folder path, and replacing relatIve database or data file references with the corresponding absolute path in an open VSCode project workspace.
84
92
85
-
Also, note in the `sqlite_attach` SQL call statement above we are escaping `\` file path delimiters on Windows OS by using `\\` characters sequence.
93
+
Also, note in the `sqlite_attach()` SQL function call statement above we are escaping `\` file path delimiters on Windows OS by using `\\` characters sequence.
86
94
87
95
# Demo Data
88
96
89
-
DuckDB SQL Tools extension github repository contains sample [/data](https://github.com/RandomFractals/duckdb-sql-tools/tree/main/data/chinook/duckdb) folder with `chinook.duckdb` and `chinook.sqlite` database files, csv, json and parquet data files, and some test SQL queries you can try running on this well-known sample database wih our VSCode extension.
97
+
DuckDB SQL Tools extension documentation repository contains sample [/data](https://github.com/RandomFractals/sql-duckdb-tools/tree/main/data/chinook/duckdb) folder with [`chinook.duckdb`](https://github.com/RandomFractals/duckdb-sql-tools/blob/main/data/chinook/duckdb/chinook.duckdb) and [`chinook.sqlite`](https://github.com/RandomFractals/duckdb-sql-tools/blob/main/data/chinook/sqlite/chinook.sqlite) database files, csv, json and parquet data files you can download to get started using DuckDB with our SQL Tools VSCode extension.
98
+
99
+
The [cninook/duckdb](https://github.com/RandomFractals/duckdb-sql-tools/tree/main/data/chinook/duckdb) demo data folder also has sample SQL query files you try running on this well-known sample database with our VSCode extension.
Due to the limited time and minimal development effort invested into building this free trial DuckDB SQL Tools extension, our first Preview alpha version of this extension comes with the following known limitations and supported usage scenarios.
105
+
Due to the limited time and minimal development effort invested into building this Free Trial DuckDB SQL Tools extension, our first Preview alpha version of this extension comes with the following known limitations and supported usage scenarios.
96
106
97
107
## DuckDB Storage
98
108
@@ -108,9 +118,9 @@ Future paid Premium and/or Pro versions of this extension might provide write ca
108
118
109
119
## In-Memory DuckDB
110
120
111
-
Meanwhile, you can experiment with writable `:memory:` DuckDB instances in this DuckDB SQL Tools Preview extension version. In-Memory DuckDB instances function similar to [In-Memory SQLite Databases](https://www.sqlite.org/inmemorydb.html). You can use [DuckDB Import Data](https://duckdb.org/docs/data/overview) and [Atach](https://duckdb.org/docs/sql/statements/attach) features available via DuckDB SQL statments, and use [Export Database](https://duckdb.org/docs/sql/statements/export) SQL statements to export created in-memory DuckDB instances.
121
+
Meanwhile, you can experiment with writable `:memory:` DuckDB instances in this DuckDB SQL Tools Preview extension version. In-Memory DuckDB instances function similar to [In-Memory SQLite Databases](https://www.sqlite.org/inmemorydb.html). You can use [DuckDB Import Data](https://duckdb.org/docs/data/overview) and [Atach](https://duckdb.org/docs/sql/statements/attach) features available via DuckDB SQL statements, and use [Export Database](https://duckdb.org/docs/sql/statements/export) SQL statements to export created in-memory DuckDB instances.
112
122
113
-
DuckDB SQL Tools extension lets you create in-memory database instances by specifying `:memory:` in the Database File field of the new DuckDB connection in SQLTools Connection Assistant as demonstrated in DuckDB HTTPFS and SQLite Scanner extension usage examples above.
123
+
DuckDB SQL Tools extension lets you create in-memory database instances by specifying `:memory:`keyword in the Database File field of the new DuckDB connection in SQLTools Connection Assistant as demonstrated in DuckDB HTTPFS and SQLite Scanner extension usage examples above.
114
124
115
125
**Note**: **only** in-memory DuckDB database instances are open in `read/write` mode in this DuckDB SQL Tools extension Preview release to avoid DuckDB instance file access locking.
116
126
@@ -143,14 +153,14 @@ The following [SQLTools Settings](https://vscode-sqltools.mteixeira.dev/en/setti
143
153
|```"sqltools.disableNodeDetectNotifications": true```| Disable Node runtime detection notifications after initial SQLTools extension installation to prevent Node runtime information message display on every new VSCode session start. |
144
154
|```"sqltools.autoOpenSessionFiles": false```| Prevent auto open of new session SQL editor instance after connecting to the databaase instance. |
145
155
|```"sqltools.results.limit": 10000```| Maximum number of records to return in results. SQLTools defaults to displaying only 50 records in query results view. Changing this limit setting to 1000 or 10000 will show more data rows to inspect in result views. |
146
-
|```"sqltools.results.location": "current"```| Defines the edigor group to use for result table views. SQLTools displays all results in the next editor group to show results on the side next to the active SQL query editor. Changing this setting to `current` will display results in the same editor group and display more result colulmns. |
156
+
|```"sqltools.results.location": "current"```| Defines the editor group to use for result table views. SQLTools displays all results in the next editor group to show results on the side next to the active SQL query editor. Changing this setting to `current` will display results in the same editor group and display more result columns. |
147
157
148
158
# Feedback
149
159
150
-
Use [DuckDB SQL Tools Github Discussions](https://github.com/RandomFractals/duckdb-sql-tools/discussions) portal to submit your feedback, share examples of how you are using this VSCode extension, or request new trivial and premium features. Our aim is to make DuckDB more accessible and easier to use in VSCode IDE and Terminal.
160
+
Use [DuckDB SQL Tools Github Discussions](https://github.com/RandomFractals/duckdb-sql-tools/discussions) portal to submit your feedback, share examples of how you are using this VSCode extension, or request new trivial and premium features. Our goal with this extension is to make DuckDB more accessible and easier to use in VSCode IDE and Terminal.
151
161
152
162
# Support
153
163
154
-
Become a [Fan and Sponsor](https://github.com/sponsors/RandomFractals/sponsorships?sponsor=RandomFractals&tier_id=18883) our dev efforts on this and other [Random Fractals, Inc. code and data viz extensions](https://marketplace.visualstudio.com/publishers/RandomFractalsInc) if you find them useful, educational, or enhancing your daily dataViz dev code workflows and exploratory data analysis:
164
+
Become a [Fan and Sponsor](https://github.com/sponsors/RandomFractals/sponsorships?sponsor=RandomFractals&tier_id=18883) our dev efforts on this and other [Random Fractals, Inc. code and data viz extensions](https://marketplace.visualstudio.com/publishers/RandomFractalsInc) if you find them useful, educational, or enhancing your daily dataViz dev code workflows and exploratory data analysis experience.
0 commit comments