SQL Table Completion Schema Qualification (sql/sqlCompletionSchemaQualification.ts)

dbx · apps/desktop/src/lib/sql/sqlCompletionSchemaQualification.ts · typescript · Apache-2.0
database, tag:code, tag:completion

Normalizes SQL table schema qualification settings for code completion.

// Source: https://github.com/t8y2/dbx | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
export type SqlTableCompletionSchemaQualification = "never" | "collision" | "always";

export const DEFAULT_SQL_TABLE_COMPLETION_SCHEMA_QUALIFICATION: SqlTableCompletionSchemaQualification = "collision";

export function normalizeSqlTableCompletionSchemaQualification(value: unknown): SqlTableCompletionSchemaQualification {
  if (value === "never" || value === "collision" || value === "always") return value;
  return DEFAULT_SQL_TABLE_COMPLETION_SCHEMA_QUALIFICATION;
}

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key