Skip to content

Commit 7f757f0

Browse files
committed
first publish
1 parent 1cf4986 commit 7f757f0

18 files changed

+437
-299
lines changed

.eslintrc.json

+16-20
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,18 @@
11
{
2-
"root": true,
3-
"parser": "@typescript-eslint/parser",
4-
"parserOptions": {
5-
"ecmaVersion": 6,
6-
"sourceType": "module"
7-
},
8-
"plugins": [
9-
"@typescript-eslint"
10-
],
11-
"rules": {
12-
"@typescript-eslint/naming-convention": "warn",
13-
"@typescript-eslint/semi": "warn",
14-
"curly": "warn",
15-
"eqeqeq": "warn",
16-
"no-throw-literal": "warn",
17-
"semi": "off"
18-
},
19-
"ignorePatterns": [
20-
"**/*.d.ts"
21-
]
2+
"root": true,
3+
"parser": "@typescript-eslint/parser",
4+
"parserOptions": {
5+
"ecmaVersion": 6,
6+
"sourceType": "module"
7+
},
8+
"plugins": ["@typescript-eslint"],
9+
"rules": {
10+
"@typescript-eslint/naming-convention": "warn",
11+
"@typescript-eslint/semi": "warn",
12+
"curly": "warn",
13+
"eqeqeq": "warn",
14+
"no-throw-literal": "warn",
15+
"semi": "off"
16+
},
17+
"ignorePatterns": ["**/*.d.ts"]
2218
}

.prettierrc.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
semi: true
2+
singleQuote: true

.vscode/extensions.json

-8
This file was deleted.

.vscode/launch.json

-13
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,6 @@
3333
],
3434
"debugWebviews": true,
3535
"preLaunchTask": "npm: watch"
36-
},
37-
{
38-
"name": "Extension Tests",
39-
"type": "extensionHost",
40-
"request": "launch",
41-
"args": [
42-
"--extensionDevelopmentPath=${workspaceFolder}",
43-
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
44-
],
45-
"outFiles": [
46-
"${workspaceFolder}/out/test/**/*.js"
47-
],
48-
"preLaunchTask": "${defaultBuildTask}"
4936
}
5037
]
5138
}

.vscode/settings.json

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// Place your settings in this file to overwrite default and user settings.
21
{
32
"files.exclude": {
43
"out": false // set this to true to hide the "out" folder with the compiled JS files

CHANGELOG.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
# Change Log
22

3-
All notable changes to the "sqlnotebook" extension will be documented in this file.
4-
5-
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
6-
73
## [Unreleased]
84

9-
- Initial release
5+
- Initial release

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) Charles Moog
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE

README.md

+21-18
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,31 @@
1-
# sqlnotebook
1+
# VS Code SQL Notebook
22

3-
⚠️ Work-in-progress starter code for custom notebook renderers in VS Code. Expect this to change as notebooks matures. ⚠️
3+
> ⚠️ This extension is under active development and is currently in an **alpha** state ⚠️
44
5-
This starter includes:
5+
Execute SQL queries in the VS Code Notebook interface.
6+
View query output and inspect errors interactively.
67

7-
- 🖥️ TypeScript code to create a simple `NotebookOutputRenderer`
8-
- 📦 A Webpack build for renderer client code
9-
- ⚡ Support for hot module reloading and safe boilerplate
10-
- 🎨 CSS modules support
8+
<img width="1009" alt="Screen Shot 2021-08-14 at 2 51 30 PM" src="https://user-images.githubusercontent.com/7585078/129458651-270070d2-32fe-46b7-a2f2-4ee9c611d876.png">
119

12-
### Running this Sample
10+
## Usage
1311

14-
1. `cd sqlnotebook`
15-
1. `code-insiders .`: Open the folder in VS Code Insiders
16-
1. Hit `F5` to build+debug
12+
Open a blank SQL file with the `Open With` menu option. Then, select the `SQL Notebook` format.
1713

18-
### Structure
14+
<img width="585" alt="Screen Shot 2021-08-14 at 2 51 57 PM" src="https://user-images.githubusercontent.com/7585078/129458647-d9015433-f879-4ac3-a1ad-3a8380617e82.png">
1915

20-
A Notebook Renderer consists of code that runs in the VS Code Extension Host (Node.js), which registers the renderer and passes data into the UI code running inside a WebView (Browser/DOM).
16+
<img width="788" alt="Screen Shot 2021-08-14 at 2 52 09 PM" src="https://user-images.githubusercontent.com/7585078/129458646-fcc0139a-a9b0-4fa4-af0e-a4b872f10176.png">
2117

22-
This uses TypeScript project references. There are three projects in the `src` directory:
18+
### Connection Config
2319

24-
- `extension` contains the code running in Node.js extension host. It's compiled with `tsc`.
25-
- `client` is the UI code, built by Webpack, with access to the DOM.
26-
- `common` contains code shared between the extension and client.
20+
Currently, the SQL Notebooks require you to execute a YAML cell specifying the
21+
connection configuration with the following schema:
2722

28-
When you run `watch`, `compile`, or `dev`, we invoke both `tsc` and `webpack` to compile the extension and the client portion of the code.
23+
```yaml
24+
host: string
25+
port: number
26+
user: string
27+
password: string
28+
database: string
29+
```
30+
31+
After executing this cell, executing SQL cells will use the associated connection.

package.json

+37-13
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,48 @@
11
{
22
"name": "sqlnotebook",
3-
"displayName": "sqlnotebook",
3+
"displayName": "SQL Notebook",
4+
"publisher": "cmoog",
45
"description": "A notebook for exploratory SQL work.",
5-
"version": "0.0.1",
6+
"preview": true,
7+
"repository": {
8+
"url": "https://github.com/cmoog/vscode-sqlnotebook"
9+
},
10+
"version": "0.0.4",
611
"engines": {
712
"vscode": "^1.59.0"
813
},
914
"categories": [
10-
"Other"
15+
"Data Science",
16+
"Machine Learning",
17+
"Notebooks",
18+
"Visualization"
19+
],
20+
"activationEvents": [
21+
"onNotebook:sql-notebook"
1122
],
12-
"activationEvents": [],
1323
"main": "./out/extension/extension.js",
24+
"capabilities": {
25+
"virtualWorkspaces": true,
26+
"untrustedWorkspaces": {
27+
"supported": false
28+
}
29+
},
1430
"contributes": {
15-
"notebookRenderer": [
31+
"notebooks": [
1632
{
17-
"id": "sqlnotebook",
18-
"entrypoint": "./out/client/index.js",
33+
"type": "sql-notebook",
1934
"displayName": "SQL Notebook",
20-
"mimeTypes": ["x-application/sample-json-renderer"]
35+
"priority": "option",
36+
"selector": [
37+
{
38+
"filenamePattern": "*.sql"
39+
}
40+
]
2141
}
2242
]
2343
},
2444
"scripts": {
25-
"vscode:prepublish": "npm run compile && node out/test/checkNoTestProvider.js",
45+
"vscode:prepublish": "npm run compile",
2646
"compile": "npm run compile:extension && npm run compile:client",
2747
"compile:extension": "tsc -b",
2848
"compile:client": "webpack --mode production",
@@ -31,18 +51,18 @@
3151
"watch:extension": "tsc -b --watch",
3252
"watch:client": "webpack --mode development --watch",
3353
"dev": "concurrently -r npm:watch:extension npm:watch:client",
34-
"pretest": "npm run compile && npm run lint",
35-
"test": "node ./out/test/runTest.js"
54+
"fmt": "npx prettier -w ./*.{jsx,ts,tsx,json,yaml,yml,md}"
3655
},
3756
"devDependencies": {
57+
"@types/escape-html": "^1.0.1",
3858
"@types/glob": "^7.1.3",
3959
"@types/mocha": "^8.2.2",
4060
"@types/node": "14.x",
61+
"@types/vscode": "^1.59.0",
62+
"@types/vscode-notebook-renderer": "^1.57.8",
4163
"@types/webpack-env": "^1.16.0",
4264
"@typescript-eslint/eslint-plugin": "^4.26.0",
4365
"@typescript-eslint/parser": "^4.26.0",
44-
"@types/vscode-notebook-renderer": "^1.57.8",
45-
"@types/vscode": "^1.59.0",
4666
"concurrently": "^5.3.0",
4767
"css-loader": "^4.2.0",
4868
"eslint": "^7.27.0",
@@ -56,5 +76,9 @@
5676
"vscode-test": "^1.5.2",
5777
"webpack": "^5.38.1",
5878
"webpack-cli": "^4.7.0"
79+
},
80+
"dependencies": {
81+
"mysql2": "^2.3.0",
82+
"yaml": "^1.10.2"
5983
}
6084
}

0 commit comments

Comments
 (0)