CoolFace
Apppublic

AK-21/Graphite-Industrial-Intelligence

sourceHugging Faceupdated 3mo agoView on Hugging Face
0likes
indexes.cjs84 linesDownload Raw Back to sqlite-core
1"use strict";2var __defProp = Object.defineProperty;3var __getOwnPropDesc = Object.getOwnPropertyDescriptor;4var __getOwnPropNames = Object.getOwnPropertyNames;5var __hasOwnProp = Object.prototype.hasOwnProperty;6var __export = (target, all) => {7  for (var name in all)8    __defProp(target, name, { get: all[name], enumerable: true });9};10var __copyProps = (to, from, except, desc) => {11  if (from && typeof from === "object" || typeof from === "function") {12    for (let key of __getOwnPropNames(from))13      if (!__hasOwnProp.call(to, key) && key !== except)14        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });15  }16  return to;17};18var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);19var indexes_exports = {};20__export(indexes_exports, {21  Index: () => Index,22  IndexBuilder: () => IndexBuilder,23  IndexBuilderOn: () => IndexBuilderOn,24  index: () => index,25  uniqueIndex: () => uniqueIndex26});27module.exports = __toCommonJS(indexes_exports);28var import_entity = require("../entity.cjs");29class IndexBuilderOn {30  constructor(name, unique) {31    this.name = name;32    this.unique = unique;33  }34  static [import_entity.entityKind] = "SQLiteIndexBuilderOn";35  on(...columns) {36    return new IndexBuilder(this.name, columns, this.unique);37  }38}39class IndexBuilder {40  static [import_entity.entityKind] = "SQLiteIndexBuilder";41  /** @internal */42  config;43  constructor(name, columns, unique) {44    this.config = {45      name,46      columns,47      unique,48      where: void 049    };50  }51  /**52   * Condition for partial index.53   */54  where(condition) {55    this.config.where = condition;56    return this;57  }58  /** @internal */59  build(table) {60    return new Index(this.config, table);61  }62}63class Index {64  static [import_entity.entityKind] = "SQLiteIndex";65  config;66  constructor(config, table) {67    this.config = { ...config, table };68  }69}70function index(name) {71  return new IndexBuilderOn(name, false);72}73function uniqueIndex(name) {74  return new IndexBuilderOn(name, true);75}76// Annotate the CommonJS export names for ESM import in node:770 && (module.exports = {78  Index,79  IndexBuilder,80  IndexBuilderOn,81  index,82  uniqueIndex83});84//# sourceMappingURL=indexes.cjs.map