Package-level declarations

Types

Link copied to clipboard
class CompletionLevel(idQuote: String, idCaseInsensitive: Boolean)

A tree node used to build the schema-completion hierarchy.

Link copied to clipboard
data class DialectSpec(val backslashEscapes: Boolean = false, val hashComments: Boolean = false, val spaceAfterDashes: Boolean = false, val slashComments: Boolean = false, val doubleQuotedStrings: Boolean = false, val doubleDollarQuotedStrings: Boolean = false, val unquotedBitLiterals: Boolean = false, val treatBitsAsBytes: Boolean = false, val charSetCasts: Boolean = false, val plsqlQuotingMechanism: Boolean = false, val operatorChars: String = "*+-%<>!=&|~^/", val specialVar: String = "?", val identifierQuotes: String = "", val caseInsensitiveIdentifiers: Boolean = false, val words: Map<String, Int> = emptyMap())

Spec for an SQL dialect tokenizer configuration.

Link copied to clipboard
data class SqlCompletionConfig(val dialect: SQLDialect? = null, val schema: SqlSchema? = null, val tables: List<Any>? = null, val schemas: List<Any>? = null, val defaultTable: String? = null, val defaultSchema: String? = null, val upperCaseKeywords: Boolean = false, val keywordCompletion: (String, String) -> Completion? = null)

Configuration for schemaCompletionSource.

Link copied to clipboard
class SQLDialect(dialect: DialectSpec, val language: LRLanguage, val spec: SqlDialectDef)

Represents an SQL dialect with its associated language and tokenizer configuration.

Link copied to clipboard
data class SqlDialectDef(val backslashEscapes: Boolean? = null, val hashComments: Boolean? = null, val spaceAfterDashes: Boolean? = null, val slashComments: Boolean? = null, val doubleQuotedStrings: Boolean? = null, val doubleDollarQuotedStrings: Boolean? = null, val unquotedBitLiterals: Boolean? = null, val treatBitsAsBytes: Boolean? = null, val charSetCasts: Boolean? = null, val plsqlQuotingMechanism: Boolean? = null, val operatorChars: String? = null, val specialVar: String? = null, val identifierQuotes: String? = null, val caseInsensitiveIdentifiers: Boolean? = null, val keywords: String? = null, val types: String? = null, val builtin: String? = null)

Definition for an SQL dialect. All fields are optional; missing fields fall back to the default values defined in defaults.

Link copied to clipboard
typealias SqlSchema = Map<String, Any>

A schema definition for SQL autocompletion. Keys are schema/table names, values are either lists of column names (strings or Completion) or nested schema maps.

Properties

Link copied to clipboard

Dialect for Cassandra's SQL-ish query language.

Link copied to clipboard

Variant of MySQL for MariaDB.

Link copied to clipboard

SQL dialect for Microsoft SQL Server.

Link copied to clipboard

MySQL dialect.

Link copied to clipboard

PL/SQL dialect.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

SQLite dialect.

Link copied to clipboard

The standard SQL dialect.

Link copied to clipboard

The default tokens tokenizer (uses defaults dialect).

Functions

Link copied to clipboard
fun buildKeywords(keywords: String, types: String, builtin: String? = null): Map<String, Int>

Build a keywords lookup map for a dialect.

Link copied to clipboard
fun completeFromSchema(schema: SqlSchema, tables: List<Any>? = null, schemas: List<Any>? = null, defaultTableName: String? = null, defaultSchemaName: String? = null, dialect: SQLDialect? = null): CompletionSource

Create a completion source from a schema definition.

Link copied to clipboard
fun keywordCompletionSource(dialect: SQLDialect, upperCase: Boolean = false, build: (String, String) -> Completion? = null): CompletionSource

Returns a completion source that provides keyword completion for the given SQL dialect.

Link copied to clipboard

Returns a completion source that provides schema-based completion for the given config.

Link copied to clipboard
fun sql(config: SqlCompletionConfig = SqlCompletionConfig()): LanguageSupport

SQL language support for the given SQL dialect, with keyword completion, and, if provided, schema-based completion as extra extensions.

Link copied to clipboard