Sql Formatter Format SQL files using the sql-formatter-plus npm package.
$ brew install node #출력값 Updating Homebrew... ==> Auto-updated Homebrew! Updated 1 tap (homebrew/cask). ==> Updated Casks Updated 2 casks. ==> Downloading https://ghcr.io/v2/homebrew/core/node/manifests/16.4.0 Already downloaded: /Users/llallallall/Library/Caches/Homebrew/downloads/8a31ceb59cd7f7cb7e0b248cdb070c7882c2a8665305504e53af5869e2f3e02d--node-16.4.0.bottle_manifest.json ==> Downloading https://ghcr.io/v2/homebrew/core/node/blobs/sha256:7b9323a45487b Already downloaded: /Users/llallallall/Library/Caches/Homebrew/downloads/5d20fc557ebb276538058e73ef645d887624ddc4b8b36532da81bc26e226c756--node--16.4.0.big_sur.bottle.tar.gz ==> Pouring node--16.4.0.big_sur.bottle.tar.gz 🍺 /usr/local/Cellar/node/16.4.0: 2,459 files, 48.1MB
$ npm -v #출력값 7.18.1
$ npm install sql-formatter #출력값 added 2 packages, and audited 4 packages in 555ms found 0 vulnerabilities
"[sql]": { // adpyke.vscode-sql-formatter 익스텐션을 통해 포맷팅하도록 설정 "editor.defaultFormatter": "adpyke.vscode-sql-formatter" }, // sql 키워드(select, from 등)를 대문자로 자동 치환 "sql-formatter.uppercase": true, // sql 쿼리와 쿼리 사이의 줄간격 "sql-formatter.linesBetweenQueries": 2
'use strict'; const vscode = require('vscode'); const sqlFormatter = require('sql-formatter-plus'); const getSetting = (group, key, def) => { const settings = vscode.workspace.getConfiguration(group, null); const editor = vscode.window.activeTextEditor; const language = editor && editor.document && editor.document.languageId; const languageSettings = language && vscode.workspace.getConfiguration(null, null).get(`[${language}]`); let value = languageSettings && languageSettings[`${group}.${key}`]; if (value == null) value = settings.get(key, def); return value == null ? def : value; }; const getConfig = ({ insertSpaces, tabSize }) => ({ indent: insertSpaces ? ' '.repeat(tabSize) : '\t', language: getSetting('sql-formatter', 'dialect', 'sql'), uppercase: getSetting('sql-formatter', 'uppercase', false), linesBetweenQueries: getSetting('sql-formatter', 'linesBetweenQueries', 2) }); const format = (text, config) => sqlFormatter.format(text, config); module.exports.activate = () => vscode.languages.registerDocumentRangeFormattingEditProvider('sql', { provideDocumentRangeFormattingEdits: (document, range, options) => [ vscode.TextEdit.replace(range, format(document.getText(range), getConfig(options))) ] });
'use strict'; const vscode = require('vscode'); const sqlFormatter = require('sql-formatter-plus'); const getSetting = (group, key, def) => { const settings = vscode.workspace.getConfiguration(group, null); const editor = vscode.window.activeTextEditor; const language = editor && editor.document && editor.document.languageId; const languageSettings = language && vscode.workspace.getConfiguration(null, null).get(`[${language}]`); let value = languageSettings && languageSettings[`${group}.${key}`]; if (value == null) value = settings.get(key, def); return value == null ? def : value; }; const getConfig = ({ insertSpaces, tabSize }) => ({ indent: insertSpaces ? ' '.repeat(tabSize) : '\t', language: getSetting('sql-formatter', 'dialect', 'sql'), uppercase: getSetting('sql-formatter', 'uppercase', false), linesBetweenQueries: getSetting('sql-formatter', 'linesBetweenQueries', 2) }); const format = (text, config) => sqlFormatter.format(text, config); module.exports.activate = () => vscode.languages.registerDocumentRangeFormattingEditProvider('oraclesql', { provideDocumentRangeFormattingEdits: (document, range, options) => [ vscode.TextEdit.replace(range, format(document.getText(range), getConfig(options))) ] });
brightly님의 새글 알림을 받으실려면 구독
제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|
세퀘이아 15.1 beta4(24B5046f) 전체 프로그램 다운로드(24/09/2... | 제로섬 | 24.09.2005:37 | 12 |
windows & macOS / Install macOS Sequoia beta4 15.1_24B50... | 제로섬 | 24.09.2005:24 | 10 |
Apple Beta Releases 소식 (09/17일자) | 제로섬 | 24.09.1808:05 | 77 |
세퀘이아 15.0 정식(24A335) 전체 프로그램(24/09/17일자) +3 | 제로섬 | 24.09.1704:38 | 234 |
windows & macOS / Install macOS Sequoia 정식 15.0_24A335.... | 제로섬 | 24.07.1806:01 | 665 |
Apple macOS UniversalMac_15.0 정식 (24A335)복원IPSW (24/09/17... +3 | 제로섬 | 24.09.1020:58 | 145 |
Apple RC Releases 소식 24/09/10일자 | 제로섬 | 24.09.1011:27 | 232 |
Apple macOS UniversalMac_15.0 beta8 (24A5331b)복원IPSW (24/0... | 제로섬 | 24.08.3020:41 | 103 |
macOS Sonoma 14.7 RC2 (23H124) 전체 프로그램 다운로드(24/09/1... | 제로섬 | 24.08.3015:43 | 268 |
macOS Ventura 13.7 RC2 (22H123) 전체 프로그램 다운로드(24/09/... | 제로섬 | 24.08.3016:24 | 124 |
windows & macOS / Install macOS Sonoma RC2 14.7_23H124.d... +1 | 제로섬 | 23.10.1211:27 | 4867 |
windows & macOS / Install macOS Ventura RC2 13.7.0_22H123... +1 | 제로섬 | 23.10.1213:08 | 7722 |
Apple Beta Releases 소식 24/08/28일자 | 제로섬 | 24.08.2904:14 | 170 |
Apple 2024년 9월 9일 월요일, 첫 번째 가을 이벤트 & Glowti... +1 | 제로섬 | 24.08.2721:47 | 115 |
Apple M1/M2/M3 macOS Sequoia 15.1 beta4 (24B5046f)복원IPSW (2... | 제로섬 | 24.08.1320:14 | 125 |
Apple Public Releases for 소식 24/08/07일자 | 제로섬 | 24.08.0809:53 | 126 |
macOS Sonoma 14.6.1 정식 (23G93) 전체 프로그램 다운로드(24/08... +4 | 제로섬 | 24.07.3018:28 | 633 |
macOS Ventura 13.6.9 정식 (22G830) 전체 프로그램 다운로드(24/... | 제로섬 | 24.07.3018:21 | 241 |
macOS Monterey 12.7.6 정식 (21H1320) 전체 프로그램 다운로드 (... +2 | 제로섬 | 24.07.3018:04 | 188 |
Apple Public Releases for 소식 24/07/29일자 +3 | 제로섬 | 24.07.3014:14 | 115 |
Apple, macOS 15 Sequoia 공개 정보 +2 | 제로섬 | 24.07.0716:59 | 2990 |
Safari_18_정식 설치프로그램_macOS_Sonoma(619A63)&Ventura(... +1 | 제로섬 | 24.07.0619:09 | 2448 |
Apple M1/M2/M3 macOS Sonoma 14.6.1 정식 (23G93)복원IPSW (24/0... | 제로섬 | 24.06.1811:51 | 2265 |
비 지원 맥용 OpenCore-Legacy-Patcher 2.0.1 다운로드(24/09/17... +6 | 제로섬 | 23.06.0413:37 | 2.6만 |
Safari_17.6_for_Ventura&Monterey 정식 설치 프로그램 24/07... +1 | 제로섬 | 24.04.0717:28 | 3781 |
windows & macOS / Install macOS Sonoma 정식 14.6.1_22G93.... +1 | 제로섬 | 24.04.0520:26 | 3716 |
windows & macOS / Install macOS Ventura 정식 13.6.9_22G83... | 제로섬 | 24.04.0521:40 | 3499 |
windows & macOS / Install macOS Monterey 정식 12.7.6_21H1... | 제로섬 | 24.04.0522:27 | 3459 |
윈도우 11 23H2 ISO 다운로드 가능 +2 | Mactopia | 23.11.0423:27 | 1.6만 |
Windows에서 macOS 부팅 가능한 USB를 만드는 방법 +16 | 제로섬 | 23.10.0711:52 | 1.9만 |
windows & macOS / Install macOS Big Sur 11.7.10_20G1427.d... | 제로섬 | 23.07.2512:50 | 2.2만 |
여친 없는 엑팔인들을 위한 스팀 게임 몇 가지 나눔 합니다. +27 | 잠퉁이 | 23.03.0220:10 | 6.6만 |
최신 Windows 다운로드 +12 | Dokdo | 21.10.1703:35 | 4.6만 |
윈도우 필수 유틸 #1 - Hoax Eliminator 구라 제거기 +4 | Mactopia | 21.08.1017:08 | 4.4만 |
우분투 서버 설치하기 +3 | 매킨어렵 | 21.06.0404:29 | 3.5만 |
아이폰15 베타 제거 +6 | Nelson | 24.09.1711:45 | 93 |
맥북프로 2014년형 업데이트 안됨 +2 | 해킨독립 | 24.09.1818:57 | 81 |
Mid 2011 Air macOS Sequoia 잘 되네요 | wmy0317 | 24.09.1821:35 | 108 |
제로섬 | 24.09.2005:37 | 12 | |
제로섬 | 24.09.2005:24 | 10 | |
wmy0317 | 24.09.1821:35 | 108 | |
해킨독립 | 24.09.1818:57 | 81 | |
제로섬 | 24.09.1808:05 | 77 | |
제로섬 | 24.09.1704:38 | 234 | |
제로섬 | 24.07.1806:01 | 665 | |
제로섬 | 24.09.1608:54 | 291 | |
제로섬 | 24.09.1020:58 | 145 | |
제로섬 | 24.09.1011:27 | 232 | |
제로섬 | 24.09.1002:10 | 61 | |
Mactopia | 24.09.0509:15 | 84 | |
제로섬 | 24.08.3020:41 | 103 | |
제로섬 | 24.08.3015:43 | 268 | |
제로섬 | 24.08.3016:24 | 124 | |
제로섬 | 24.08.3015:27 | 156 | |
제로섬 | 23.10.1211:27 | 4867 | |
제로섬 | 23.10.1213:08 | 7722 | |
제로섬 | 24.08.2904:14 | 170 | |
제로섬 | 24.08.2721:47 | 115 | |
제로섬 | 24.08.2215:27 | 136 | |
제로섬 | 24.08.2103:34 | 179 | |
잠퉁이 | 24.08.1700:47 | 118 | |
제로섬 | 24.08.1405:39 | 106 | |
제로섬 | 24.08.1320:14 | 125 | |
제로섬 | 24.08.1307:26 | 117 | |
제로섬 | 24.08.1214:46 | 161 | |
배고픈사람 | 24.08.0816:27 | 134 | |
제로섬 | 24.08.0809:53 | 126 | |
제로섬 | 24.08.0705:08 | 134 | |
jcher | 24.08.0609:19 | 56 | |
제로섬 | 24.08.0603:33 | 138 | |
Mactopia | 24.07.3122:27 | 129 | |
제로섬 | 24.07.3018:28 | 633 | |
제로섬 | 24.07.3018:21 | 241 | |
제로섬 | 24.07.3018:04 | 188 | |
제로섬 | 24.07.3014:14 | 115 | |
제로섬 | 24.07.3004:37 | 114 | |
잠퉁이 | 24.07.2505:11 | 94 | |
제로섬 | 24.07.2506:37 | 129 | |
제로섬 | 24.07.2406:51 | 164 | |
제로섬 | 24.07.1703:39 | 779 | |
제로섬 | 24.07.1604:47 | 1020 | |
제로섬 | 24.07.1602:37 | 897 | |
제로섬 | 24.07.1312:38 | 1646 | |
잠퉁이 | 24.07.1104:03 | 1975 | |
제로섬 | 24.07.1113:07 | 1996 | |
제로섬 | 24.07.1109:51 | 1949 | |
제로섬 | 24.07.1109:45 | 1942 | |
제로섬 | 24.07.1109:37 | 1970 | |
제로섬 | 24.07.1002:55 | 2921 | |
제로섬 | 24.07.0716:59 | 2990 | |
제로섬 | 24.07.0619:09 | 2448 | |
제로섬 | 24.07.0308:18 | 1312 | |
제로섬 | 23.10.1215:11 | 7909 | |
제로섬 | 24.07.0308:33 | 1282 | |
제로섬 | 24.07.0308:24 | 1299 | |
쥬쥬댕 | 24.07.0214:24 | 1252 | |
제로섬 | 24.07.0209:35 | 2389 | |
제로섬 | 24.07.0209:13 | 1324 | |
Mactopia | 24.06.2622:09 | 912 | |
Mactopia | 24.06.2617:09 | 887 | |
제로섬 | 24.06.2612:10 | 1201 | |
제로섬 | 24.06.2513:12 | 595 | |
제로섬 | 24.06.2309:45 | 275 | |
제로섬 | 24.06.2111:16 | 204 | |
제로섬 | 24.06.2111:06 | 192 | |
제로섬 | 24.06.2110:57 | 202 | |
제로섬 | 24.06.1811:51 | 2265 | |
제로섬 | 24.06.1808:37 | 130 | |
제로섬 | 24.06.1710:41 | 25 | |
제로섬 | 24.06.1615:15 | 38 | |
제로섬 | 24.06.1415:34 | 39 | |
제로섬 | 24.06.1108:08 | 2287 | |
제로섬 | 24.06.1107:55 | 2559 | |
제로섬 | 24.06.0815:10 | 70 | |
제로섬 | 23.06.0413:37 | 2.6만 | |
RogerT | 24.05.2805:45 | 126 | |
제로섬 | 24.05.2710:29 | 73 | |
제로섬 | 24.05.1504:27 | 58 |
Mac SQL Client로는 DBeaver도 쓸만합니다.