UNPKG

@itwin/core-bentley

Version:

Bentley JavaScript core components

184 lines • 12.8 kB
"use strict"; /*--------------------------------------------------------------------------------------------- * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ /** @packageDocumentation * @module BeSQLite */ Object.defineProperty(exports, "__esModule", { value: true }); exports.DbResult = exports.DbOpcode = exports.OpenMode = void 0; /** Whether to open a database readonly or writeable. * @public */ var OpenMode; (function (OpenMode) { OpenMode[OpenMode["Readonly"] = 1] = "Readonly"; OpenMode[OpenMode["ReadWrite"] = 2] = "ReadWrite"; })(OpenMode || (exports.OpenMode = OpenMode = {})); /** Values, stored in changesets, that indicate what operation was performed on the database. * @public */ var DbOpcode; (function (DbOpcode) { /** A row was deleted. */ DbOpcode[DbOpcode["Delete"] = 9] = "Delete"; /** A new row was inserted. */ DbOpcode[DbOpcode["Insert"] = 18] = "Insert"; /** Some columns of an existing row were updated. */ DbOpcode[DbOpcode["Update"] = 23] = "Update"; })(DbOpcode || (exports.DbOpcode = DbOpcode = {})); /** Values for return codes from BeSQLite functions. Consult SQLite documentation for further explanations. * @public */ // Disabling for the rest of the file since eslint does not correctly parse the entire enum, only parts of it var DbResult; (function (DbResult) { /** Success */ DbResult[DbResult["BE_SQLITE_OK"] = 0] = "BE_SQLITE_OK"; /** SQL error or missing database */ DbResult[DbResult["BE_SQLITE_ERROR"] = 1] = "BE_SQLITE_ERROR"; /** Internal logic error */ DbResult[DbResult["BE_SQLITE_INTERNAL"] = 2] = "BE_SQLITE_INTERNAL"; /** Access permission denied */ DbResult[DbResult["BE_SQLITE_PERM"] = 3] = "BE_SQLITE_PERM"; /** Callback routine requested an abort */ DbResult[DbResult["BE_SQLITE_ABORT"] = 4] = "BE_SQLITE_ABORT"; /** The database file is locked */ DbResult[DbResult["BE_SQLITE_BUSY"] = 5] = "BE_SQLITE_BUSY"; /** A table in the database is locked */ DbResult[DbResult["BE_SQLITE_LOCKED"] = 6] = "BE_SQLITE_LOCKED"; /** A malloc() failed */ DbResult[DbResult["BE_SQLITE_NOMEM"] = 7] = "BE_SQLITE_NOMEM"; /** Attempt to write a readonly database */ DbResult[DbResult["BE_SQLITE_READONLY"] = 8] = "BE_SQLITE_READONLY"; /** Operation terminated by interrupt */ DbResult[DbResult["BE_SQLITE_INTERRUPT"] = 9] = "BE_SQLITE_INTERRUPT"; /** Some kind of disk I/O error occurred */ DbResult[DbResult["BE_SQLITE_IOERR"] = 10] = "BE_SQLITE_IOERR"; /** The database disk image is malformed */ DbResult[DbResult["BE_SQLITE_CORRUPT"] = 11] = "BE_SQLITE_CORRUPT"; /** NOT USED. Table or record not found */ DbResult[DbResult["BE_SQLITE_NOTFOUND"] = 12] = "BE_SQLITE_NOTFOUND"; /** Insertion failed because database is full or write operation failed because disk is full */ DbResult[DbResult["BE_SQLITE_FULL"] = 13] = "BE_SQLITE_FULL"; /** Unable to open the database file */ DbResult[DbResult["BE_SQLITE_CANTOPEN"] = 14] = "BE_SQLITE_CANTOPEN"; /** Database lock protocol error */ DbResult[DbResult["BE_SQLITE_PROTOCOL"] = 15] = "BE_SQLITE_PROTOCOL"; /** Database is empty */ DbResult[DbResult["BE_SQLITE_EMPTY"] = 16] = "BE_SQLITE_EMPTY"; /** The database schema changed */ DbResult[DbResult["BE_SQLITE_SCHEMA"] = 17] = "BE_SQLITE_SCHEMA"; /** String or BLOB exceeds size limit */ DbResult[DbResult["BE_SQLITE_TOOBIG"] = 18] = "BE_SQLITE_TOOBIG"; /** Abort due to constraint violation. See extended error values. */ DbResult[DbResult["BE_SQLITE_CONSTRAINT_BASE"] = 19] = "BE_SQLITE_CONSTRAINT_BASE"; /** Data type mismatch */ DbResult[DbResult["BE_SQLITE_MISMATCH"] = 20] = "BE_SQLITE_MISMATCH"; /** Library used incorrectly */ DbResult[DbResult["BE_SQLITE_MISUSE"] = 21] = "BE_SQLITE_MISUSE"; /** Uses OS features not supported on host */ DbResult[DbResult["BE_SQLITE_NOLFS"] = 22] = "BE_SQLITE_NOLFS"; /** Authorization denied */ DbResult[DbResult["BE_SQLITE_AUTH"] = 23] = "BE_SQLITE_AUTH"; /** Auxiliary database format error */ DbResult[DbResult["BE_SQLITE_FORMAT"] = 24] = "BE_SQLITE_FORMAT"; /** 2nd parameter to Bind out of range */ DbResult[DbResult["BE_SQLITE_RANGE"] = 25] = "BE_SQLITE_RANGE"; /** File opened that is not a database file */ DbResult[DbResult["BE_SQLITE_NOTADB"] = 26] = "BE_SQLITE_NOTADB"; /** Step() has another row ready */ DbResult[DbResult["BE_SQLITE_ROW"] = 100] = "BE_SQLITE_ROW"; /** Step() has finished executing */ DbResult[DbResult["BE_SQLITE_DONE"] = 101] = "BE_SQLITE_DONE"; DbResult[DbResult["BE_SQLITE_IOERR_READ"] = 266] = "BE_SQLITE_IOERR_READ"; DbResult[DbResult["BE_SQLITE_IOERR_SHORT_READ"] = 522] = "BE_SQLITE_IOERR_SHORT_READ"; DbResult[DbResult["BE_SQLITE_IOERR_WRITE"] = 778] = "BE_SQLITE_IOERR_WRITE"; DbResult[DbResult["BE_SQLITE_IOERR_FSYNC"] = 1034] = "BE_SQLITE_IOERR_FSYNC"; DbResult[DbResult["BE_SQLITE_IOERR_DIR_FSYNC"] = 1290] = "BE_SQLITE_IOERR_DIR_FSYNC"; DbResult[DbResult["BE_SQLITE_IOERR_TRUNCATE"] = 1546] = "BE_SQLITE_IOERR_TRUNCATE"; DbResult[DbResult["BE_SQLITE_IOERR_FSTAT"] = 1802] = "BE_SQLITE_IOERR_FSTAT"; DbResult[DbResult["BE_SQLITE_IOERR_UNLOCK"] = 2058] = "BE_SQLITE_IOERR_UNLOCK"; DbResult[DbResult["BE_SQLITE_IOERR_RDLOCK"] = 2314] = "BE_SQLITE_IOERR_RDLOCK"; DbResult[DbResult["BE_SQLITE_IOERR_DELETE"] = 2570] = "BE_SQLITE_IOERR_DELETE"; DbResult[DbResult["BE_SQLITE_IOERR_BLOCKED"] = 2826] = "BE_SQLITE_IOERR_BLOCKED"; DbResult[DbResult["BE_SQLITE_IOERR_NOMEM"] = 3082] = "BE_SQLITE_IOERR_NOMEM"; DbResult[DbResult["BE_SQLITE_IOERR_ACCESS"] = 3338] = "BE_SQLITE_IOERR_ACCESS"; DbResult[DbResult["BE_SQLITE_IOERR_CHECKRESERVEDLOCK"] = 3594] = "BE_SQLITE_IOERR_CHECKRESERVEDLOCK"; DbResult[DbResult["BE_SQLITE_IOERR_LOCK"] = 3850] = "BE_SQLITE_IOERR_LOCK"; DbResult[DbResult["BE_SQLITE_IOERR_CLOSE"] = 4106] = "BE_SQLITE_IOERR_CLOSE"; DbResult[DbResult["BE_SQLITE_IOERR_DIR_CLOSE"] = 4362] = "BE_SQLITE_IOERR_DIR_CLOSE"; DbResult[DbResult["BE_SQLITE_IOERR_SHMOPEN"] = 4618] = "BE_SQLITE_IOERR_SHMOPEN"; DbResult[DbResult["BE_SQLITE_IOERR_SHMSIZE"] = 4874] = "BE_SQLITE_IOERR_SHMSIZE"; DbResult[DbResult["BE_SQLITE_IOERR_SHMLOCK"] = 5130] = "BE_SQLITE_IOERR_SHMLOCK"; DbResult[DbResult["BE_SQLITE_IOERR_SHMMAP"] = 5386] = "BE_SQLITE_IOERR_SHMMAP"; DbResult[DbResult["BE_SQLITE_IOERR_SEEK"] = 5642] = "BE_SQLITE_IOERR_SEEK"; DbResult[DbResult["BE_SQLITE_IOERR_DELETE_NOENT"] = 5898] = "BE_SQLITE_IOERR_DELETE_NOENT"; /** attempt to create a new file when a file by that name already exists */ DbResult[DbResult["BE_SQLITE_ERROR_FileExists"] = 16777226] = "BE_SQLITE_ERROR_FileExists"; /** attempt to open a BeSQLite::Db that is already in use somewhere. */ DbResult[DbResult["BE_SQLITE_ERROR_AlreadyOpen"] = 33554442] = "BE_SQLITE_ERROR_AlreadyOpen"; /** attempt to open a BeSQLite::Db that doesn't have a property table. */ DbResult[DbResult["BE_SQLITE_ERROR_NoPropertyTable"] = 50331658] = "BE_SQLITE_ERROR_NoPropertyTable"; /** the database name is not a file. */ DbResult[DbResult["BE_SQLITE_ERROR_FileNotFound"] = 67108874] = "BE_SQLITE_ERROR_FileNotFound"; /** there is no transaction active and the database was opened with AllowImplicitTransactions=false */ DbResult[DbResult["BE_SQLITE_ERROR_NoTxnActive"] = 83886090] = "BE_SQLITE_ERROR_NoTxnActive"; /** wrong BeSQLite profile version */ DbResult[DbResult["BE_SQLITE_ERROR_BadDbProfile"] = 100663306] = "BE_SQLITE_ERROR_BadDbProfile"; /** Profile of file could not be determined. */ DbResult[DbResult["BE_SQLITE_ERROR_InvalidProfileVersion"] = 117440522] = "BE_SQLITE_ERROR_InvalidProfileVersion"; /** Upgrade of profile of file failed. */ DbResult[DbResult["BE_SQLITE_ERROR_ProfileUpgradeFailed"] = 134217738] = "BE_SQLITE_ERROR_ProfileUpgradeFailed"; /** Profile of file is too old. Therefore file can only be opened read-only. */ DbResult[DbResult["BE_SQLITE_ERROR_ProfileTooOldForReadWrite"] = 150994954] = "BE_SQLITE_ERROR_ProfileTooOldForReadWrite"; /** Profile of file is too old. Therefore file cannot be opened. */ DbResult[DbResult["BE_SQLITE_ERROR_ProfileTooOld"] = 167772170] = "BE_SQLITE_ERROR_ProfileTooOld"; /** Profile of file is too new for read-write access. Therefore file can only be opened read-only. */ DbResult[DbResult["BE_SQLITE_ERROR_ProfileTooNewForReadWrite"] = 184549386] = "BE_SQLITE_ERROR_ProfileTooNewForReadWrite"; /** Profile of file is too new. Therefore file cannot be opened. */ DbResult[DbResult["BE_SQLITE_ERROR_ProfileTooNew"] = 201326602] = "BE_SQLITE_ERROR_ProfileTooNew"; /** attempt to commit with active changetrack */ DbResult[DbResult["BE_SQLITE_ERROR_ChangeTrackError"] = 218103818] = "BE_SQLITE_ERROR_ChangeTrackError"; /** invalid version of the revision file is being imported */ DbResult[DbResult["BE_SQLITE_ERROR_InvalidChangeSetVersion"] = 234881034] = "BE_SQLITE_ERROR_InvalidChangeSetVersion"; /** The schemas found in the database need to be upgraded */ DbResult[DbResult["BE_SQLITE_ERROR_SchemaUpgradeRequired"] = 251658250] = "BE_SQLITE_ERROR_SchemaUpgradeRequired"; /** The schemas found in the database are too new, and the application needs to be upgraded. */ DbResult[DbResult["BE_SQLITE_ERROR_SchemaTooNew"] = 268435466] = "BE_SQLITE_ERROR_SchemaTooNew"; /** The schemas found in the database are too old, and the DgnDb needs to be upgraded. */ DbResult[DbResult["BE_SQLITE_ERROR_SchemaTooOld"] = 285212682] = "BE_SQLITE_ERROR_SchemaTooOld"; /** Error acquiring a lock on the schemas before upgrade. */ DbResult[DbResult["BE_SQLITE_ERROR_SchemaLockFailed"] = 301989898] = "BE_SQLITE_ERROR_SchemaLockFailed"; /** Error upgrading the schemas in the database. */ DbResult[DbResult["BE_SQLITE_ERROR_SchemaUpgradeFailed"] = 318767114] = "BE_SQLITE_ERROR_SchemaUpgradeFailed"; /** Error importing the schemas into the database. */ DbResult[DbResult["BE_SQLITE_ERROR_SchemaImportFailed"] = 335544330] = "BE_SQLITE_ERROR_SchemaImportFailed"; /** Error acquiring locks or codes */ DbResult[DbResult["BE_SQLITE_ERROR_CouldNotAcquireLocksOrCodes"] = 352321546] = "BE_SQLITE_ERROR_CouldNotAcquireLocksOrCodes"; /** Recommended that the schemas found in the database be upgraded */ DbResult[DbResult["BE_SQLITE_ERROR_SchemaUpgradeRecommended"] = 369098762] = "BE_SQLITE_ERROR_SchemaUpgradeRecommended"; /** schema update require data transform */ DbResult[DbResult["BE_SQLITE_ERROR_DataTransformRequired"] = 385875978] = "BE_SQLITE_ERROR_DataTransformRequired"; DbResult[DbResult["BE_SQLITE_LOCKED_SHAREDCACHE"] = 262] = "BE_SQLITE_LOCKED_SHAREDCACHE"; DbResult[DbResult["BE_SQLITE_BUSY_RECOVERY"] = 261] = "BE_SQLITE_BUSY_RECOVERY"; DbResult[DbResult["BE_SQLITE_CANTOPEN_NOTEMPDIR"] = 270] = "BE_SQLITE_CANTOPEN_NOTEMPDIR"; DbResult[DbResult["BE_SQLITE_CANTOPEN_ISDIR"] = 526] = "BE_SQLITE_CANTOPEN_ISDIR"; DbResult[DbResult["BE_SQLITE_CANTOPEN_FULLPATH"] = 782] = "BE_SQLITE_CANTOPEN_FULLPATH"; DbResult[DbResult["BE_SQLITE_CORRUPT_VTAB"] = 267] = "BE_SQLITE_CORRUPT_VTAB"; DbResult[DbResult["BE_SQLITE_READONLY_RECOVERY"] = 264] = "BE_SQLITE_READONLY_RECOVERY"; DbResult[DbResult["BE_SQLITE_READONLY_CANTLOCK"] = 520] = "BE_SQLITE_READONLY_CANTLOCK"; DbResult[DbResult["BE_SQLITE_READONLY_ROLLBACK"] = 776] = "BE_SQLITE_READONLY_ROLLBACK"; DbResult[DbResult["BE_SQLITE_ABORT_ROLLBACK"] = 516] = "BE_SQLITE_ABORT_ROLLBACK"; DbResult[DbResult["BE_SQLITE_CONSTRAINT_CHECK"] = 275] = "BE_SQLITE_CONSTRAINT_CHECK"; DbResult[DbResult["BE_SQLITE_CONSTRAINT_COMMITHOOK"] = 531] = "BE_SQLITE_CONSTRAINT_COMMITHOOK"; DbResult[DbResult["BE_SQLITE_CONSTRAINT_FOREIGNKEY"] = 787] = "BE_SQLITE_CONSTRAINT_FOREIGNKEY"; DbResult[DbResult["BE_SQLITE_CONSTRAINT_FUNCTION"] = 1043] = "BE_SQLITE_CONSTRAINT_FUNCTION"; DbResult[DbResult["BE_SQLITE_CONSTRAINT_NOTNULL"] = 1299] = "BE_SQLITE_CONSTRAINT_NOTNULL"; DbResult[DbResult["BE_SQLITE_CONSTRAINT_PRIMARYKEY"] = 1555] = "BE_SQLITE_CONSTRAINT_PRIMARYKEY"; DbResult[DbResult["BE_SQLITE_CONSTRAINT_TRIGGER"] = 1811] = "BE_SQLITE_CONSTRAINT_TRIGGER"; DbResult[DbResult["BE_SQLITE_CONSTRAINT_UNIQUE"] = 2067] = "BE_SQLITE_CONSTRAINT_UNIQUE"; DbResult[DbResult["BE_SQLITE_CONSTRAINT_VTAB"] = 2323] = "BE_SQLITE_CONSTRAINT_VTAB"; })(DbResult || (exports.DbResult = DbResult = {})); //# sourceMappingURL=BeSQLite.js.map