[ WEBSITE | ISSUES | FORUM | CHANGELOG ]
This package implements SQL language support for the CodeMirror code editor.
The project page has more information, a number of examples and the documentation.
This code is released under an MIT license.
We aim to be an inclusive, welcoming community. To make that explicit, we have a code of conduct that applies to communication around the project.
API Referencesql(configâ ?: SQLConfig = {}) â LanguageSupport
SQL language support for the given SQL dialect, with keyword completion, and, if provided, schema-based completion as extra extensions.
interface
SQLConfig
Options used to configure an SQL extension.
dialectâ ?: SQLDialect
The dialect to use. Defaults to StandardSQL
.
schemaâ ?: Object<readonly (string | Completion)[]>
An object that maps table names, optionally prefixed with a schema name ("schema.table"
) to options (columns) that can be completed for that table. Use lower-case names here.
tablesâ ?: readonly Completion[]
By default, the completions for the table names will be generated from the schema
object. But if you want to customize them, you can pass an array of completions through this option.
defaultTableâ ?: string
When given, columns from the named table can be completed directly at the top level.
defaultSchemaâ ?: string
When given, tables prefixed with this schema name can be completed directly at the top level.
upperCaseKeywordsâ ?: boolean
When set to true, keyword completions will be upper-case.
class
SQLDialect
Represents an SQL dialect.
language: LRLanguage
The language for this dialect.
extension: Extension
Returns the language for this dialect as an extension.
static define(spec: Object) â SQLDialect
Define a new dialect.
spec
keywordsâ ?: string
A space-separated list of keywords for the dialect.
builtinâ ?: string
A space-separated string of built-in identifiers for the dialect.
typesâ ?: string
A space-separated string of type names for the dialect.
backslashEscapesâ ?: boolean
Controls whether regular strings allow backslash escapes.
Controls whether # creates a line comment.
Controls whether //
creates a line comment.
spaceAfterDashesâ ?: boolean
When enabled --
comments are only recognized when there's a space after the dashes.
doubleDollarQuotedStringsâ ?: boolean
When enabled, things quoted with "$" are treated as strings, rather than identifiers.
doubleQuotedStringsâ ?: boolean
When enabled, things quoted with double quotes are treated as strings, rather than identifiers.
charSetCastsâ ?: boolean
Enables strings like _utf8'str'
or N'str'
.
operatorCharsâ ?: string
The set of characters that make up operators. Defaults to "*+\-%<>!=&|~^/"
.
specialVarâ ?: string
The set of characters that start a special variable name. Defaults to "?"
.
identifierQuotesâ ?: string
The characters that can be used to quote identifiers. Defaults to "\""
.
StandardSQL: SQLDialect
The standard SQL dialect.
PostgreSQL: SQLDialect
Dialect for PostgreSQL.
MySQL: SQLDialect
MySQL dialect.
MariaSQL: SQLDialect
MSSQL: SQLDialect
SQL dialect for Microsoft SQL Server.
SQLite: SQLDialect
SQLite dialect.
Cassandra: SQLDialect
Dialect for Cassandra's SQL-ish query language.
PLSQL: SQLDialect
PL/SQL dialect.
keywordCompletionSource(dialect: SQLDialect, upperCaseâ ?: boolean = false) â CompletionSource
Returns a completion source that provides keyword completion for the given SQL dialect.
schemaCompletionSource(config: SQLConfig) â CompletionSource
Returns a completion sources that provides schema-based completion for the given configuration.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4