Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
monaco-sql-languages
Advanced tools
This is a SQL Languages project for Monaco Editor forked it from monaco-languages. The differences are we integrated with many kinds of SQL Languages for BigData domain, like FLinkSQL, SParkSQL, HiveSQL, and so on. We provided the basic SQL syntax validation feature by dt-sql-parser, and we are going to provide Autocomplete feature in future.
Online Preview: https://dtstack.github.io/monaco-sql-languages/
npm install monaco-sql-languages
or
yarn add monaco-sql-languages
Add language worker in the Webpack
entry
field:
entry: {
'sparksql.worker': 'monaco-sql-languages/out/esm/sparksql/sparksql.worker.js',
'flinksql.worker': 'monaco-sql-languages/out/esm/flinksql/flinksql.worker.js'),
'hivesql.worker': 'monaco-sql-languages/out/esm/hivesql/hivesql.worker.js'),
'mysql.worker': 'monaco-sql-languages/out/esm/mysql/mysql.worker.js'),
'pgsql.worker': 'monaco-sql-languages/out/esm/pgsql/pgsql.worker.js'),
'plsql.worker': 'monaco-sql-languages/out/esm/plsql/plsql.worker.js'),
'sql.worker': 'monaco-sql-languages/out/esm/sql/sql.worker.js')
},
Define the MonacoEnvironment
for worker
file:
window.MonacoEnvironment = {
getWorkerUrl: function (moduleId, label) {
switch (label) {
case 'sparksql': {
return './sparksql.worker.js';
}
case 'flinksql': {
return './flinksql.worker.js';
}
case 'hivesql': {
return './hivesql.worker.js';
}
case 'mysql': {
return './mysql.worker.js';
}
case 'pgsql': {
return './pgsql.worker.js';
}
case 'plsql': {
return './plsql.worker.js';
}
case 'sql': {
return './sql.worker.js';
}
default: {
return './editor.worker.js';
}
}
}
};
Import the language contribution before creating the editor by monaco-editor
:
import 'monaco-sql-languages/out/esm/flinksql/flinksql.contribution';
import 'monaco-sql-languages/out/esm/hivesql/hivesql.contribution';
import 'monaco-sql-languages/out/esm/sparksql/sparksql.contribution';
import 'monaco-sql-languages/out/esm/mysql/mysql.contribution';
import 'monaco-sql-languages/out/esm/pgsql/pgsql.contribution';
import 'monaco-sql-languages/out/esm/plsql/plsql.contribution';
import 'monaco-sql-languages/out/esm/sql/sql.contribution';
Then, set the language value you need when creating the moanco-editor
instance:
monaco.editor.create(document.getElementById("container"), {
value: "select * from tb_test",
language: "sql" // you need
});
Tips: you can change the editor model language by
monaco.editor.setModelLanguage(model, language)
Reference from here.
npm install .
npm run dev
npm run watch
npm run test
npm run prepublishOnly
$/src/myLang/myLang.contribution.ts
$/src/myLang/myLang.ts
$/src/myLang/myLang.test.ts
$/src/monaco.contribution.ts
and register your new languageimport './myLang/myLang.contribution';
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
FAQs
SQL languages for the Monaco Editor, based on monaco-languages.
The npm package monaco-sql-languages receives a total of 3,564 weekly downloads. As such, monaco-sql-languages popularity was classified as popular.
We found that monaco-sql-languages demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 7 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.