var ne = Object.defineProperty;
var i = (t, e) => ne(t, "name", { value: e, configurable: !0 });
import { LRLanguage as ie, LRParser as se, LanguageSupport as oe, indentNodeProp as le, foldNodeProp as ce, styleTags as de, continuedIndent as me, tags as s, ExternalTokenizer as ue, ifNotIn as fe, completeFromList as pe, syntaxTree as ge } from "../../../editor.js";
const he = 36, j = 1, _e = 2, v = 3, q = 4, be = 5, ve = 6, ye = 7, ke = 8, xe = 9, Oe = 10, we = 11, Qe = 12, Ce = 13, Se = 14, Pe = 15, qe = 16, Te = 17, D = 18, Ue = 19, K = 20, M = 21, Z = 22, ze = 23, Be = 24;
function U(t) {
  return t >= 65 && t <= 90 || t >= 97 && t <= 122 || t >= 48 && t <= 57;
}
i(U, "isAlpha");
function Le(t) {
  return t >= 48 && t <= 57 || t >= 97 && t <= 102 || t >= 65 && t <= 70;
}
i(Le, "isHexDigit");
function h(t, e, r) {
  for (let a = !1; ; ) {
    if (t.next < 0)
      return;
    if (t.next == e && !a) {
      t.advance();
      return;
    }
    a = r && !a && t.next == 92, t.advance();
  }
}
i(h, "readLiteral");
function Xe(t, e) {
  e: for (; ; ) {
    if (t.next < 0)
      return;
    if (t.next == 36) {
      t.advance();
      for (let r = 0; r < e.length; r++) {
        if (t.next != e.charCodeAt(r))
          continue e;
        t.advance();
      }
      if (t.next == 36) {
        t.advance();
        return;
      }
    } else
      t.advance();
  }
}
i(Xe, "readDoubleDollarLiteral");
function Ie(t, e) {
  let r = "[{<(".indexOf(String.fromCharCode(e)), a = r < 0 ? e : "]}>)".charCodeAt(r);
  for (; ; ) {
    if (t.next < 0)
      return;
    if (t.next == a && t.peek(1) == 39) {
      t.advance(2);
      return;
    }
    t.advance();
  }
}
i(Ie, "readPLSQLQuotedLiteral");
function z(t, e) {
  for (; !(t.next != 95 && !U(t.next)); )
    e != null && (e += String.fromCharCode(t.next)), t.advance();
  return e;
}
i(z, "readWord");
function Re(t) {
  if (t.next == 39 || t.next == 34 || t.next == 96) {
    let e = t.next;
    t.advance(), h(t, e, !1);
  } else
    z(t);
}
i(Re, "readWordOrQuoted");
function N(t, e) {
  for (; t.next == 48 || t.next == 49; )
    t.advance();
  e && t.next == e && t.advance();
}
i(N, "readBits");
function V(t, e) {
  for (; ; ) {
    if (t.next == 46) {
      if (e)
        break;
      e = !0;
    } else if (t.next < 48 || t.next > 57)
      break;
    t.advance();
  }
  if (t.next == 69 || t.next == 101)
    for (t.advance(), (t.next == 43 || t.next == 45) && t.advance(); t.next >= 48 && t.next <= 57; )
      t.advance();
}
i(V, "readNumber");
function $(t) {
  for (; !(t.next < 0 || t.next == 10); )
    t.advance();
}
i($, "eol");
function g(t, e) {
  for (let r = 0; r < e.length; r++)
    if (e.charCodeAt(r) == t)
      return !0;
  return !1;
}
i(g, "inString");
const T = ` 	\r
`;
function F(t, e, r) {
  let a = /* @__PURE__ */ Object.create(null);
  a.true = a.false = be, a.null = a.unknown = ve;
  for (let n of t.split(" "))
    n && (a[n] = K);
  for (let n of e.split(" "))
    n && (a[n] = M);
  for (let n of (r || "").split(" "))
    n && (a[n] = Be);
  return a;
}
i(F, "keywords");
const _ = "array binary bit boolean char character clob date decimal double float int integer interval large national nchar nclob numeric object precision real smallint time timestamp varchar varying ", b = "absolute action add after all allocate alter and any are as asc assertion at authorization before begin between both breadth by call cascade cascaded case cast catalog check close collate collation column commit condition connect connection constraint constraints constructor continue corresponding count create cross cube current current_date current_default_transform_group current_transform_group_for_type current_path current_role current_time current_timestamp current_user cursor cycle data day deallocate declare default deferrable deferred delete depth deref desc describe descriptor deterministic diagnostics disconnect distinct do domain drop dynamic each else elseif end end-exec equals escape except exception exec execute exists exit external fetch first for foreign found from free full function general get global go goto grant group grouping handle having hold hour identity if immediate in indicator initially inner inout input insert intersect into is isolation join key language last lateral leading leave left level like limit local localtime localtimestamp locator loop map match method minute modifies module month names natural nesting new next no none not of old on only open option or order ordinality out outer output overlaps pad parameter partial path prepare preserve primary prior privileges procedure public read reads recursive redo ref references referencing relative release repeat resignal restrict result return returns revoke right role rollback rollup routine row rows savepoint schema scroll search second section select session session_user set sets signal similar size some space specific specifictype sql sqlexception sqlstate sqlwarning start state static system_user table temporary then timezone_hour timezone_minute to trailing transaction translation treat trigger under undo union unique unnest until update usage user using value values view when whenever where while with without work write year zone ", B = {
  backslashEscapes: !1,
  hashComments: !1,
  spaceAfterDashes: !1,
  slashComments: !1,
  doubleQuotedStrings: !1,
  doubleDollarQuotedStrings: !1,
  unquotedBitLiterals: !1,
  treatBitsAsBytes: !1,
  charSetCasts: !1,
  plsqlQuotingMechanism: !1,
  operatorChars: "*+-%<>!=&|~^/",
  specialVar: "?",
  identifierQuotes: '"',
  caseInsensitiveIdentifiers: !1,
  words: /* @__PURE__ */ F(b, _)
};
function je(t, e, r, a) {
  let n = {};
  for (let o in B)
    n[o] = (t.hasOwnProperty(o) ? t : B)[o];
  return e && (n.words = F(e, r || "", a)), n;
}
i(je, "dialect");
function G(t) {
  return new ue((e) => {
    var r;
    let { next: a } = e;
    if (e.advance(), g(a, T)) {
      for (; g(e.next, T); )
        e.advance();
      e.acceptToken(he);
    } else if (a == 36 && t.doubleDollarQuotedStrings) {
      let n = z(e, "");
      e.next == 36 && (e.advance(), Xe(e, n), e.acceptToken(v));
    } else if (a == 39 || a == 34 && t.doubleQuotedStrings)
      h(e, a, t.backslashEscapes), e.acceptToken(v);
    else if (a == 35 && t.hashComments || a == 47 && e.next == 47 && t.slashComments)
      $(e), e.acceptToken(j);
    else if (a == 45 && e.next == 45 && (!t.spaceAfterDashes || e.peek(1) == 32))
      $(e), e.acceptToken(j);
    else if (a == 47 && e.next == 42) {
      e.advance();
      for (let n = 1; ; ) {
        let o = e.next;
        if (e.next < 0)
          break;
        if (e.advance(), o == 42 && e.next == 47) {
          if (n--, e.advance(), !n)
            break;
        } else o == 47 && e.next == 42 && (n++, e.advance());
      }
      e.acceptToken(_e);
    } else if ((a == 101 || a == 69) && e.next == 39)
      e.advance(), h(e, 39, !0), e.acceptToken(v);
    else if ((a == 110 || a == 78) && e.next == 39 && t.charSetCasts)
      e.advance(), h(e, 39, t.backslashEscapes), e.acceptToken(v);
    else if (a == 95 && t.charSetCasts)
      for (let n = 0; ; n++) {
        if (e.next == 39 && n > 1) {
          e.advance(), h(e, 39, t.backslashEscapes), e.acceptToken(v);
          break;
        }
        if (!U(e.next))
          break;
        e.advance();
      }
    else if (t.plsqlQuotingMechanism && (a == 113 || a == 81) && e.next == 39 && e.peek(1) > 0 && !g(e.peek(1), T)) {
      let n = e.peek(1);
      e.advance(2), Ie(e, n), e.acceptToken(v);
    } else if (a == 40)
      e.acceptToken(ye);
    else if (a == 41)
      e.acceptToken(ke);
    else if (a == 123)
      e.acceptToken(xe);
    else if (a == 125)
      e.acceptToken(Oe);
    else if (a == 91)
      e.acceptToken(we);
    else if (a == 93)
      e.acceptToken(Qe);
    else if (a == 59)
      e.acceptToken(Ce);
    else if (t.unquotedBitLiterals && a == 48 && e.next == 98)
      e.advance(), N(e), e.acceptToken(Z);
    else if ((a == 98 || a == 66) && (e.next == 39 || e.next == 34)) {
      const n = e.next;
      e.advance(), t.treatBitsAsBytes ? (h(e, n, t.backslashEscapes), e.acceptToken(ze)) : (N(e, n), e.acceptToken(Z));
    } else if (a == 48 && (e.next == 120 || e.next == 88) || (a == 120 || a == 88) && e.next == 39) {
      let n = e.next == 39;
      for (e.advance(); Le(e.next); )
        e.advance();
      n && e.next == 39 && e.advance(), e.acceptToken(q);
    } else if (a == 46 && e.next >= 48 && e.next <= 57)
      V(e, !0), e.acceptToken(q);
    else if (a == 46)
      e.acceptToken(Se);
    else if (a >= 48 && a <= 57)
      V(e, !1), e.acceptToken(q);
    else if (g(a, t.operatorChars)) {
      for (; g(e.next, t.operatorChars); )
        e.advance();
      e.acceptToken(Pe);
    } else if (g(a, t.specialVar))
      e.next == a && e.advance(), Re(e), e.acceptToken(Te);
    else if (g(a, t.identifierQuotes))
      h(e, a, !1), e.acceptToken(Ue);
    else if (a == 58 || a == 44)
      e.acceptToken(qe);
    else if (U(a)) {
      let n = z(e, String.fromCharCode(a));
      e.acceptToken(e.next == 46 || e.peek(-n.length - 1) == 46 ? D : (r = t.words[n.toLowerCase()]) !== null && r !== void 0 ? r : D);
    }
  });
}
i(G, "tokensFor");
const Y = /* @__PURE__ */ G(B), De = /* @__PURE__ */ se.deserialize({
  version: 14,
  states: "%vQ]QQOOO#wQRO'#DSO$OQQO'#CwO%eQQO'#CxO%lQQO'#CyO%sQQO'#CzOOQQ'#DS'#DSOOQQ'#C}'#C}O'UQRO'#C{OOQQ'#Cv'#CvOOQQ'#C|'#C|Q]QQOOQOQQOOO'`QQO'#DOO(xQRO,59cO)PQQO,59cO)UQQO'#DSOOQQ,59d,59dO)cQQO,59dOOQQ,59e,59eO)jQQO,59eOOQQ,59f,59fO)qQQO,59fOOQQ-E6{-E6{OOQQ,59b,59bOOQQ-E6z-E6zOOQQ,59j,59jOOQQ-E6|-E6|O+VQRO1G.}O+^QQO,59cOOQQ1G/O1G/OOOQQ1G/P1G/POOQQ1G/Q1G/QP+kQQO'#C}O+rQQO1G.}O)PQQO,59cO,PQQO'#Cw",
  stateData: ",[~OtOSPOSQOS~ORUOSUOTUOUUOVROXSOZTO]XO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O^]ORvXSvXTvXUvXVvXXvXZvX]vX_vX`vXavXbvXcvXdvXevXfvXgvXhvX~OsvX~P!jOa_Ob_Oc_O~ORUOSUOTUOUUOVROXSOZTO^tO_UO`UOa`Ob`Oc`OdUOeUOfUOgUOhUO~OWaO~P$ZOYcO~P$ZO[eO~P$ZORUOSUOTUOUUOVROXSOZTO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O]hOsoX~P%zOajObjOcjO~O^]ORkaSkaTkaUkaVkaXkaZka]ka_ka`kaakabkackadkaekafkagkahka~Oska~P'kO^]O~OWvXYvX[vX~P!jOWnO~P$ZOYoO~P$ZO[pO~P$ZO^]ORkiSkiTkiUkiVkiXkiZki]ki_ki`kiakibkickidkiekifkigkihki~Oski~P)xOWkaYka[ka~P'kO]hO~P$ZOWkiYki[ki~P)xOasObsOcsO~O",
  goto: "#hwPPPPPPPPPPPPPPPPPPPPPPPPPPx||||!Y!^!d!xPPP#[TYOZeUORSTWZbdfqT[OZQZORiZSWOZQbRQdSQfTZgWbdfqQ^PWk^lmrQl_Qm`RrseVORSTWZbdfq",
  nodeNames: "⚠ LineComment BlockComment String Number Bool Null ( ) { } [ ] ; . Operator Punctuation SpecialVar Identifier QuotedIdentifier Keyword Type Bits Bytes Builtin Script Statement CompositeIdentifier Parens Braces Brackets Statement",
  maxTerm: 38,
  nodeProps: [
    ["isolate", -4, 1, 2, 3, 19, ""]
  ],
  skippedNodes: [0, 1, 2],
  repeatNodeCount: 3,
  tokenData: "RORO",
  tokenizers: [0, Y],
  topRules: { Script: [0, 25] },
  tokenPrec: 0
});
function L(t) {
  let e = t.cursor().moveTo(t.from, -1);
  for (; /Comment/.test(e.name); )
    e.moveTo(e.from, -1);
  return e.node;
}
i(L, "tokenBefore");
function k(t, e) {
  let r = t.sliceString(e.from, e.to), a = /^([`'"])(.*)\1$/.exec(r);
  return a ? a[2] : r;
}
i(k, "idName");
function Q(t) {
  return t && (t.name == "Identifier" || t.name == "QuotedIdentifier");
}
i(Q, "plainID");
function Ze(t, e) {
  if (e.name == "CompositeIdentifier") {
    let r = [];
    for (let a = e.firstChild; a; a = a.nextSibling)
      Q(a) && r.push(k(t, a));
    return r;
  }
  return [k(t, e)];
}
i(Ze, "pathFor");
function A(t, e) {
  for (let r = []; ; ) {
    if (!e || e.name != ".")
      return r;
    let a = L(e);
    if (!Q(a))
      return r;
    r.unshift(k(t, a)), e = L(a);
  }
}
i(A, "parentsFor");
function Ne(t, e) {
  let r = ge(t).resolveInner(e, -1), a = $e(t.doc, r);
  return r.name == "Identifier" || r.name == "QuotedIdentifier" || r.name == "Keyword" ? {
    from: r.from,
    quoted: r.name == "QuotedIdentifier" ? t.doc.sliceString(r.from, r.from + 1) : null,
    parents: A(t.doc, L(r)),
    aliases: a
  } : r.name == "." ? { from: e, quoted: null, parents: A(t.doc, r), aliases: a } : { from: e, quoted: null, parents: [], empty: !0, aliases: a };
}
i(Ne, "sourceContext");
const Ve = /* @__PURE__ */ new Set(/* @__PURE__ */ "where group having order union intersect except all distinct limit offset fetch for".split(" "));
function $e(t, e) {
  let r;
  for (let n = e; !r; n = n.parent) {
    if (!n)
      return null;
    n.name == "Statement" && (r = n);
  }
  let a = null;
  for (let n = r.firstChild, o = !1, d = null; n; n = n.nextSibling) {
    let c = n.name == "Keyword" ? t.sliceString(n.from, n.to).toLowerCase() : null, l = null;
    if (!o)
      o = c == "from";
    else if (c == "as" && d && Q(n.nextSibling))
      l = k(t, n.nextSibling);
    else {
      if (c && Ve.has(c))
        break;
      d && Q(n) && (l = k(t, n));
    }
    l && (a || (a = /* @__PURE__ */ Object.create(null)), a[l] = Ze(t, d)), d = /Identifier$/.test(n.name) ? n : null;
  }
  return a;
}
i($e, "getAliases");
function Ae(t, e) {
  return t ? e.map((r) => Object.assign(Object.assign({}, r), { label: r.label[0] == t ? r.label : t + r.label + t, apply: void 0 })) : e;
}
i(Ae, "maybeQuoteCompletions");
const Ee = /^\w*$/, We = /^[`'"]?\w*[`'"]?$/;
function E(t) {
  return t.self && typeof t.self.label == "string";
}
i(E, "isSelfTag");
const C = class C {
  constructor(e, r) {
    this.idQuote = e, this.idCaseInsensitive = r, this.list = [], this.children = void 0;
  }
  child(e) {
    let r = this.children || (this.children = /* @__PURE__ */ Object.create(null)), a = r[e];
    return a || (e && !this.list.some((n) => n.label == e) && this.list.push(W(e, "type", this.idQuote, this.idCaseInsensitive)), r[e] = new C(this.idQuote, this.idCaseInsensitive));
  }
  maybeChild(e) {
    return this.children ? this.children[e] : null;
  }
  addCompletion(e) {
    let r = this.list.findIndex((a) => a.label == e.label);
    r > -1 ? this.list[r] = e : this.list.push(e);
  }
  addCompletions(e) {
    for (let r of e)
      this.addCompletion(typeof r == "string" ? W(r, "property", this.idQuote, this.idCaseInsensitive) : r);
  }
  addNamespace(e) {
    Array.isArray(e) ? this.addCompletions(e) : E(e) ? this.addNamespace(e.children) : this.addNamespaceObject(e);
  }
  addNamespaceObject(e) {
    for (let r of Object.keys(e)) {
      let a = e[r], n = null, o = r.replace(/\\?\./g, (c) => c == "." ? "\0" : c).split("\0"), d = this;
      E(a) && (n = a.self, a = a.children);
      for (let c = 0; c < o.length; c++)
        n && c == o.length - 1 && d.addCompletion(n), d = d.child(o[c].replace(/\\\./g, "."));
      d.addNamespace(a);
    }
  }
};
i(C, "CompletionLevel");
let X = C;
function W(t, e, r, a) {
  return new RegExp("^[a-z_][a-z_\\d]*$", a ? "i" : "").test(t) ? { label: t, type: e } : { label: t, type: e, apply: r + t + r };
}
i(W, "nameCompletion");
function Ke(t, e, r, a, n, o) {
  var d;
  let c = ((d = o == null ? void 0 : o.spec.identifierQuotes) === null || d === void 0 ? void 0 : d[0]) || '"', l = new X(c, !!(o != null && o.spec.caseInsensitiveIdentifiers)), f = n ? l.child(n) : null;
  return l.addNamespace(t), e && (f || l).addCompletions(e), r && l.addCompletions(r), f && l.addCompletions(f.list), a && l.addCompletions((f || l).child(a).list), (p) => {
    let { parents: y, from: te, quoted: x, empty: ae, aliases: O } = Ne(p.state, p.pos);
    if (ae && !p.explicit)
      return null;
    O && y.length == 1 && (y = O[y[0]] || y);
    let m = l;
    for (let w of y) {
      for (; !m.children || !m.children[w]; )
        if (m == l && f)
          m = f;
        else if (m == f && a)
          m = m.child(a);
        else
          return null;
      let R = m.maybeChild(w);
      if (!R)
        return null;
      m = R;
    }
    let re = x && p.state.sliceDoc(p.pos, p.pos + 1) == x, P = m.list;
    return m == l && O && (P = P.concat(Object.keys(O).map((w) => ({ label: w, type: "constant" })))), {
      from: te,
      to: re ? p.pos + 1 : void 0,
      options: Ae(x, P),
      validFor: x ? We : Ee
    };
  };
}
i(Ke, "completeFromSchema");
function Me(t) {
  return t == M ? "type" : t == K ? "keyword" : "variable";
}
i(Me, "completionType");
function Fe(t, e, r) {
  let a = Object.keys(t).map((n) => r(e ? n.toUpperCase() : n, Me(t[n])));
  return fe(["QuotedIdentifier", "SpecialVar", "String", "LineComment", "BlockComment", "."], pe(a));
}
i(Fe, "completeKeywords");
let Ge = /* @__PURE__ */ De.configure({
  props: [
    /* @__PURE__ */ le.add({
      Statement: /* @__PURE__ */ me()
    }),
    /* @__PURE__ */ ce.add({
      Statement(t, e) {
        return { from: Math.min(t.from + 100, e.doc.lineAt(t.from).to), to: t.to };
      },
      BlockComment(t) {
        return { from: t.from + 2, to: t.to - 2 };
      }
    }),
    /* @__PURE__ */ de({
      Keyword: s.keyword,
      Type: s.typeName,
      Builtin: /* @__PURE__ */ s.standard(s.name),
      Bits: s.number,
      Bytes: s.string,
      Bool: s.bool,
      Null: s.null,
      Number: s.number,
      String: s.string,
      Identifier: s.name,
      QuotedIdentifier: /* @__PURE__ */ s.special(s.string),
      SpecialVar: /* @__PURE__ */ s.special(s.name),
      LineComment: s.lineComment,
      BlockComment: s.blockComment,
      Operator: s.operator,
      "Semi Punctuation": s.punctuation,
      "( )": s.paren,
      "{ }": s.brace,
      "[ ]": s.squareBracket
    })
  ]
});
const S = class S {
  constructor(e, r, a) {
    this.dialect = e, this.language = r, this.spec = a;
  }
  /**
  Returns the language for this dialect as an extension.
  */
  get extension() {
    return this.language.extension;
  }
  /**
  Define a new dialect.
  */
  static define(e) {
    let r = je(e, e.keywords, e.types, e.builtin), a = ie.define({
      name: "sql",
      parser: Ge.configure({
        tokenizers: [{ from: Y, to: G(r) }]
      }),
      languageData: {
        commentTokens: { line: "--", block: { open: "/*", close: "*/" } },
        closeBrackets: { brackets: ["(", "[", "{", "'", '"', "`"] }
      }
    });
    return new S(r, a, e);
  }
};
i(S, "SQLDialect");
let u = S;
function Ye(t, e) {
  return { label: t, type: e, boost: -1 };
}
i(Ye, "defaultKeyword");
function He(t, e = !1, r) {
  return Fe(t.dialect.words, e, r || Ye);
}
i(He, "keywordCompletionSource");
function Je(t) {
  return t.schema ? Ke(t.schema, t.tables, t.schemas, t.defaultTable, t.defaultSchema, t.dialect || I) : () => null;
}
i(Je, "schemaCompletionSource");
function et(t) {
  return t.schema ? (t.dialect || I).language.data.of({
    autocomplete: Je(t)
  }) : [];
}
i(et, "schemaCompletion");
function rt(t = {}) {
  let e = t.dialect || I;
  return new oe(e.language, [
    et(t),
    e.language.data.of({
      autocomplete: He(e, t.upperCaseKeywords, t.keywordCompletion)
    })
  ]);
}
i(rt, "sql");
const I = /* @__PURE__ */ u.define({}), nt = /* @__PURE__ */ u.define({
  charSetCasts: !0,
  doubleDollarQuotedStrings: !0,
  operatorChars: "+-*/<>=~!@#%^&|`?",
  specialVar: "",
  keywords: b + "abort abs absent access according ada admin aggregate alias also always analyse analyze array_agg array_max_cardinality asensitive assert assignment asymmetric atomic attach attribute attributes avg backward base64 begin_frame begin_partition bernoulli bit_length blocked bom cache called cardinality catalog_name ceil ceiling chain char_length character_length character_set_catalog character_set_name character_set_schema characteristics characters checkpoint class class_origin cluster coalesce cobol collation_catalog collation_name collation_schema collect column_name columns command_function command_function_code comment comments committed concurrently condition_number configuration conflict connection_name constant constraint_catalog constraint_name constraint_schema contains content control conversion convert copy corr cost covar_pop covar_samp csv cume_dist current_catalog current_row current_schema cursor_name database datalink datatype datetime_interval_code datetime_interval_precision db debug defaults defined definer degree delimiter delimiters dense_rank depends derived detach detail dictionary disable discard dispatch dlnewcopy dlpreviouscopy dlurlcomplete dlurlcompleteonly dlurlcompletewrite dlurlpath dlurlpathonly dlurlpathwrite dlurlscheme dlurlserver dlvalue document dump dynamic_function dynamic_function_code element elsif empty enable encoding encrypted end_frame end_partition endexec enforced enum errcode error event every exclude excluding exclusive exp explain expression extension extract family file filter final first_value flag floor following force foreach fortran forward frame_row freeze fs functions fusion generated granted greatest groups handler header hex hierarchy hint id ignore ilike immediately immutable implementation implicit import include including increment indent index indexes info inherit inherits inline insensitive instance instantiable instead integrity intersection invoker isnull key_member key_type label lag last_value lead leakproof least length library like_regex link listen ln load location lock locked log logged lower mapping matched materialized max max_cardinality maxvalue member merge message message_length message_octet_length message_text min minvalue mod mode more move multiset mumps name namespace nfc nfd nfkc nfkd nil normalize normalized nothing notice notify notnull nowait nth_value ntile nullable nullif nulls number occurrences_regex octet_length octets off offset oids operator options ordering others over overlay overriding owned owner parallel parameter_mode parameter_name parameter_ordinal_position parameter_specific_catalog parameter_specific_name parameter_specific_schema parser partition pascal passing passthrough password percent percent_rank percentile_cont percentile_disc perform period permission pg_context pg_datatype_name pg_exception_context pg_exception_detail pg_exception_hint placing plans pli policy portion position position_regex power precedes preceding prepared print_strict_params procedural procedures program publication query quote raise range rank reassign recheck recovery refresh regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy regr_syy reindex rename repeatable replace replica requiring reset respect restart restore result_oid returned_cardinality returned_length returned_octet_length returned_sqlstate returning reverse routine_catalog routine_name routine_schema routines row_count row_number rowtype rule scale schema_name schemas scope scope_catalog scope_name scope_schema security selective self sensitive sequence sequences serializable server server_name setof share show simple skip slice snapshot source specific_name sqlcode sqlerror sqrt stable stacked standalone statement statistics stddev_pop stddev_samp stdin stdout storage strict strip structure style subclass_origin submultiset subscription substring substring_regex succeeds sum symmetric sysid system system_time table_name tables tablesample tablespace temp template ties token top_level_count transaction_active transactions_committed transactions_rolled_back transform transforms translate translate_regex trigger_catalog trigger_name trigger_schema trim trim_array truncate trusted type types uescape unbounded uncommitted unencrypted unlink unlisten unlogged unnamed untyped upper uri use_column use_variable user_defined_type_catalog user_defined_type_code user_defined_type_name user_defined_type_schema vacuum valid validate validator value_of var_pop var_samp varbinary variable_conflict variadic verbose version versioning views volatile warning whitespace width_bucket window within wrapper xmlagg xmlattributes xmlbinary xmlcast xmlcomment xmlconcat xmldeclaration xmldocument xmlelement xmlexists xmlforest xmliterate xmlnamespaces xmlparse xmlpi xmlquery xmlroot xmlschema xmlserialize xmltable xmltext xmlvalidate yes",
  types: _ + "bigint int8 bigserial serial8 varbit bool box bytea cidr circle precision float8 inet int4 json jsonb line lseg macaddr macaddr8 money numeric pg_lsn point polygon float4 int2 smallserial serial2 serial serial4 text timetz timestamptz tsquery tsvector txid_snapshot uuid xml"
}), H = "accessible algorithm analyze asensitive authors auto_increment autocommit avg avg_row_length binlog btree cache catalog_name chain change changed checkpoint checksum class_origin client_statistics coalesce code collations columns comment committed completion concurrent consistent contains contributors convert database databases day_hour day_microsecond day_minute day_second delay_key_write delayed delimiter des_key_file dev_pop dev_samp deviance directory disable discard distinctrow div dual dumpfile enable enclosed ends engine engines enum errors escaped even event events every explain extended fast field fields flush force found_rows fulltext grants handler hash high_priority hosts hour_microsecond hour_minute hour_second ignore ignore_server_ids import index index_statistics infile innodb insensitive insert_method install invoker iterate keys kill linear lines list load lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modify mutex mysql_errno no_write_to_binlog offline offset one online optimize optionally outfile pack_keys parser partition partitions password phase plugin plugins prev processlist profile profiles purge query quick range read_write rebuild recover regexp relaylog remove rename reorganize repair repeatable replace require resume rlike row_format rtree schedule schema_name schemas second_microsecond security sensitive separator serializable server share show slave slow snapshot soname spatial sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result ssl starting starts std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace terminated triggers truncate uncommitted uninstall unlock upgrade use use_frm user_resources user_statistics utc_date utc_time utc_timestamp variables views warnings xa xor year_month zerofill", J = _ + "bool blob long longblob longtext medium mediumblob mediumint mediumtext tinyblob tinyint tinytext text bigint int1 int2 int3 int4 int8 float4 float8 varbinary varcharacter precision datetime unsigned signed", ee = "charset clear edit ego help nopager notee nowarning pager print prompt quit rehash source status system tee", it = /* @__PURE__ */ u.define({
  operatorChars: "*+-%<>!=&|^",
  charSetCasts: !0,
  doubleQuotedStrings: !0,
  unquotedBitLiterals: !0,
  hashComments: !0,
  spaceAfterDashes: !0,
  specialVar: "@?",
  identifierQuotes: "`",
  keywords: b + "group_concat " + H,
  types: J,
  builtin: ee
}), st = /* @__PURE__ */ u.define({
  operatorChars: "*+-%<>!=&|^",
  charSetCasts: !0,
  doubleQuotedStrings: !0,
  unquotedBitLiterals: !0,
  hashComments: !0,
  spaceAfterDashes: !0,
  specialVar: "@?",
  identifierQuotes: "`",
  keywords: b + "always generated groupby_concat hard persistent shutdown soft virtual " + H,
  types: J,
  builtin: ee
}), ot = /* @__PURE__ */ u.define({
  keywords: b + "trigger proc view index for add constraint key primary foreign collate clustered nonclustered declare exec go if use index holdlock nolock nowait paglock pivot readcommitted readcommittedlock readpast readuncommitted repeatableread rowlock serializable snapshot tablock tablockx unpivot updlock with",
  types: _ + "bigint smallint smallmoney tinyint money real text nvarchar ntext varbinary image hierarchyid uniqueidentifier sql_variant xml",
  builtin: "binary_checksum checksum connectionproperty context_info current_request_id error_line error_message error_number error_procedure error_severity error_state formatmessage get_filestream_transaction_context getansinull host_id host_name isnull isnumeric min_active_rowversion newid newsequentialid rowcount_big xact_state object_id",
  operatorChars: "*+-%<>!=^&|/",
  specialVar: "@"
}), lt = /* @__PURE__ */ u.define({
  keywords: b + "abort analyze attach autoincrement conflict database detach exclusive fail glob ignore index indexed instead isnull notnull offset plan pragma query raise regexp reindex rename replace temp vacuum virtual",
  types: _ + "bool blob long longblob longtext medium mediumblob mediumint mediumtext tinyblob tinyint tinytext text bigint int2 int8 unsigned signed real",
  builtin: "auth backup bail changes clone databases dbinfo dump echo eqp explain fullschema headers help import imposter indexes iotrace lint load log mode nullvalue once print prompt quit restore save scanstats separator shell show stats system tables testcase timeout timer trace vfsinfo vfslist vfsname width",
  operatorChars: "*+-%<>!=&|/~",
  identifierQuotes: '`"',
  specialVar: "@:?$"
}), ct = /* @__PURE__ */ u.define({
  keywords: "add all allow alter and any apply as asc authorize batch begin by clustering columnfamily compact consistency count create custom delete desc distinct drop each_quorum exists filtering from grant if in index insert into key keyspace keyspaces level limit local_one local_quorum modify nan norecursive nosuperuser not of on one order password permission permissions primary quorum rename revoke schema select set storage superuser table three to token truncate ttl two type unlogged update use user users using values where with writetime infinity NaN",
  types: _ + "ascii bigint blob counter frozen inet list map static text timeuuid tuple uuid varint",
  slashComments: !0
}), dt = /* @__PURE__ */ u.define({
  keywords: b + "abort accept access add all alter and any arraylen as asc assert assign at attributes audit authorization avg base_table begin between binary_integer body by case cast char_base check close cluster clusters colauth column comment commit compress connected constant constraint crash create current currval cursor data_base database dba deallocate debugoff debugon declare default definition delay delete desc digits dispose distinct do drop else elseif elsif enable end entry exception exception_init exchange exclusive exists external fast fetch file for force form from function generic goto grant group having identified if immediate in increment index indexes indicator initial initrans insert interface intersect into is key level library like limited local lock log logging loop master maxextents maxtrans member minextents minus mislabel mode modify multiset new next no noaudit nocompress nologging noparallel not nowait number_base of off offline on online only option or order out package parallel partition pctfree pctincrease pctused pls_integer positive positiven pragma primary prior private privileges procedure public raise range raw rebuild record ref references refresh rename replace resource restrict return returning returns reverse revoke rollback row rowid rowlabel rownum rows run savepoint schema segment select separate set share snapshot some space split sql start statement storage subtype successful synonym tabauth table tables tablespace task terminate then to trigger truncate type union unique unlimited unrecoverable unusable update use using validate value values variable view views when whenever where while with work",
  builtin: "appinfo arraysize autocommit autoprint autorecovery autotrace blockterminator break btitle cmdsep colsep compatibility compute concat copycommit copytypecheck define echo editfile embedded feedback flagger flush heading headsep instance linesize lno loboffset logsource longchunksize markup native newpage numformat numwidth pagesize pause pno recsep recsepchar repfooter repheader serveroutput shiftinout show showmode spool sqlblanklines sqlcase sqlcode sqlcontinue sqlnumber sqlpluscompatibility sqlprefix sqlprompt sqlterminator suffix tab term termout timing trimout trimspool ttitle underline verify version wrap",
  types: _ + "ascii bfile bfilename bigserial bit blob dec long number nvarchar nvarchar2 serial smallint string text uid varchar2 xml",
  operatorChars: "*/+-%<>!=~",
  doubleQuotedStrings: !0,
  charSetCasts: !0,
  plsqlQuotingMechanism: !0
});
export {
  ct as Cassandra,
  ot as MSSQL,
  st as MariaSQL,
  it as MySQL,
  dt as PLSQL,
  nt as PostgreSQL,
  u as SQLDialect,
  lt as SQLite,
  I as StandardSQL,
  He as keywordCompletionSource,
  Je as schemaCompletionSource,
  rt as sql
};
