1 line
		
	
	
		
			37 KiB
		
	
	
	
		
			JSON
		
	
	
	
	
	
			
		
		
	
	
			1 line
		
	
	
		
			37 KiB
		
	
	
	
		
			JSON
		
	
	
	
	
	
| {"ast":null,"code":"\"use strict\";\n\nvar __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  var desc = Object.getOwnPropertyDescriptor(m, k);\n  if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n    desc = {\n      enumerable: true,\n      get: function () {\n        return m[k];\n      }\n    };\n  }\n  Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n  if (k2 === undefined) k2 = k;\n  o[k2] = m[k];\n});\nvar __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) {\n  Object.defineProperty(o, \"default\", {\n    enumerable: true,\n    value: v\n  });\n} : function (o, v) {\n  o[\"default\"] = v;\n});\nvar __importStar = this && this.__importStar || function (mod) {\n  if (mod && mod.__esModule) return mod;\n  var result = {};\n  if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n  __setModuleDefault(result, mod);\n  return result;\n};\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.mapHranaError = exports.resultSetFromHrana = exports.stmtToHrana = exports.executeHranaBatch = exports.HranaTransaction = void 0;\nconst hrana = __importStar(require(\"@libsql/hrana-client\"));\nconst api_1 = require(\"@libsql/core/api\");\nconst util_1 = require(\"@libsql/core/util\");\nclass HranaTransaction {\n  #mode;\n  #version;\n  // Promise that is resolved when the BEGIN statement completes, or `undefined` if we haven't executed the\n  // BEGIN statement yet.\n  #started;\n  /** @private */\n  constructor(mode, version) {\n    this.#mode = mode;\n    this.#version = version;\n    this.#started = undefined;\n  }\n  execute(stmt) {\n    return this.batch([stmt]).then(results => results[0]);\n  }\n  async batch(stmts) {\n    const stream = this._getStream();\n    if (stream.closed) {\n      throw new api_1.LibsqlError(\"Cannot execute statements because the transaction is closed\", \"TRANSACTION_CLOSED\");\n    }\n    try {\n      const hranaStmts = stmts.map(stmtToHrana);\n      let rowsPromises;\n      if (this.#started === undefined) {\n        // The transaction hasn't started yet, so we need to send the BEGIN statement in a batch with\n        // `hranaStmts`.\n        this._getSqlCache().apply(hranaStmts);\n        const batch = stream.batch(this.#version >= 3);\n        const beginStep = batch.step();\n        const beginPromise = beginStep.run((0, util_1.transactionModeToBegin)(this.#mode));\n        // Execute the `hranaStmts` only if the BEGIN succeeded, to make sure that we don't execute it\n        // outside of a transaction.\n        let lastStep = beginStep;\n        rowsPromises = hranaStmts.map(hranaStmt => {\n          const stmtStep = batch.step().condition(hrana.BatchCond.ok(lastStep));\n          if (this.#version >= 3) {\n            // If the Hrana version supports it, make sure that we are still in a transaction\n            stmtStep.condition(hrana.BatchCond.not(hrana.BatchCond.isAutocommit(batch)));\n          }\n          const rowsPromise = stmtStep.query(hranaStmt);\n          rowsPromise.catch(() => undefined); // silence Node warning\n          lastStep = stmtStep;\n          return rowsPromise;\n        });\n        // `this.#started` is resolved successfully only if the batch and the BEGIN statement inside\n        // of the batch are both successful.\n        this.#started = batch.execute().then(() => beginPromise).then(() => undefined);\n        try {\n          await this.#started;\n        } catch (e) {\n          // If the BEGIN failed, the transaction is unusable and we must close it. However, if the\n          // BEGIN suceeds and `hranaStmts` fail, the transaction is _not_ closed.\n          this.close();\n          throw e;\n        }\n      } else {\n        if (this.#version < 3) {\n          // The transaction has started, so we must wait until the BEGIN statement completed to make\n          // sure that we don't execute `hranaStmts` outside of a transaction.\n          await this.#started;\n        } else {\n          // The transaction has started, but we will use `hrana.BatchCond.isAutocommit()` to make\n          // sure that we don't execute `hranaStmts` outside of a transaction, so we don't have to\n          // wait for `this.#started`\n        }\n        this._getSqlCache().apply(hranaStmts);\n        const batch = stream.batch(this.#version >= 3);\n        let lastStep = undefined;\n        rowsPromises = hranaStmts.map(hranaStmt => {\n          const stmtStep = batch.step();\n          if (lastStep !== undefined) {\n            stmtStep.condition(hrana.BatchCond.ok(lastStep));\n          }\n          if (this.#version >= 3) {\n            stmtStep.condition(hrana.BatchCond.not(hrana.BatchCond.isAutocommit(batch)));\n          }\n          const rowsPromise = stmtStep.query(hranaStmt);\n          rowsPromise.catch(() => undefined); // silence Node warning\n          lastStep = stmtStep;\n          return rowsPromise;\n        });\n        await batch.execute();\n      }\n      const resultSets = [];\n      for (const rowsPromise of rowsPromises) {\n        const rows = await rowsPromise;\n        if (rows === undefined) {\n          throw new api_1.LibsqlError(\"Statement in a transaction was not executed, \" + \"probably because the transaction has been rolled back\", \"TRANSACTION_CLOSED\");\n        }\n        resultSets.push(resultSetFromHrana(rows));\n      }\n      return resultSets;\n    } catch (e) {\n      throw mapHranaError(e);\n    }\n  }\n  async executeMultiple(sql) {\n    const stream = this._getStream();\n    if (stream.closed) {\n      throw new api_1.LibsqlError(\"Cannot execute statements because the transaction is closed\", \"TRANSACTION_CLOSED\");\n    }\n    try {\n      if (this.#started === undefined) {\n        // If the transaction hasn't started yet, start it now\n        this.#started = stream.run((0, util_1.transactionModeToBegin)(this.#mode)).then(() => undefined);\n        try {\n          await this.#started;\n        } catch (e) {\n          this.close();\n          throw e;\n        }\n      } else {\n        // Wait until the transaction has started\n        await this.#started;\n      }\n      await stream.sequence(sql);\n    } catch (e) {\n      throw mapHranaError(e);\n    }\n  }\n  async rollback() {\n    try {\n      const stream = this._getStream();\n      if (stream.closed) {\n        return;\n      }\n      if (this.#started !== undefined) {\n        // We don't have to wait for the BEGIN statement to complete. If the BEGIN fails, we will\n        // execute a ROLLBACK outside of an active transaction, which should be harmless.\n      } else {\n        // We did nothing in the transaction, so there is nothing to rollback.\n        return;\n      }\n      // Pipeline the ROLLBACK statement and the stream close.\n      const promise = stream.run(\"ROLLBACK\").catch(e => {\n        throw mapHranaError(e);\n      });\n      stream.closeGracefully();\n      await promise;\n    } catch (e) {\n      throw mapHranaError(e);\n    } finally {\n      // `this.close()` may close the `hrana.Client`, which aborts all pending stream requests, so we\n      // must call it _after_ we receive the ROLLBACK response.\n      // Also note that the current stream should already be closed, but we need to call `this.close()`\n      // anyway, because it may need to do more cleanup.\n      this.close();\n    }\n  }\n  async commit() {\n    // (this method is analogous to `rollback()`)\n    try {\n      const stream = this._getStream();\n      if (stream.closed) {\n        throw new api_1.LibsqlError(\"Cannot commit the transaction because it is already closed\", \"TRANSACTION_CLOSED\");\n      }\n      if (this.#started !== undefined) {\n        // Make sure to execute the COMMIT only if the BEGIN was successful.\n        await this.#started;\n      } else {\n        return;\n      }\n      const promise = stream.run(\"COMMIT\").catch(e => {\n        throw mapHranaError(e);\n      });\n      stream.closeGracefully();\n      await promise;\n    } catch (e) {\n      throw mapHranaError(e);\n    } finally {\n      this.close();\n    }\n  }\n}\nexports.HranaTransaction = HranaTransaction;\nasync function executeHranaBatch(mode, version, batch, hranaStmts, disableForeignKeys = false) {\n  if (disableForeignKeys) {\n    batch.step().run(\"PRAGMA foreign_keys=off\");\n  }\n  const beginStep = batch.step();\n  const beginPromise = beginStep.run((0, util_1.transactionModeToBegin)(mode));\n  let lastStep = beginStep;\n  const stmtPromises = hranaStmts.map(hranaStmt => {\n    const stmtStep = batch.step().condition(hrana.BatchCond.ok(lastStep));\n    if (version >= 3) {\n      stmtStep.condition(hrana.BatchCond.not(hrana.BatchCond.isAutocommit(batch)));\n    }\n    const stmtPromise = stmtStep.query(hranaStmt);\n    lastStep = stmtStep;\n    return stmtPromise;\n  });\n  const commitStep = batch.step().condition(hrana.BatchCond.ok(lastStep));\n  if (version >= 3) {\n    commitStep.condition(hrana.BatchCond.not(hrana.BatchCond.isAutocommit(batch)));\n  }\n  const commitPromise = commitStep.run(\"COMMIT\");\n  const rollbackStep = batch.step().condition(hrana.BatchCond.not(hrana.BatchCond.ok(commitStep)));\n  rollbackStep.run(\"ROLLBACK\").catch(_ => undefined);\n  if (disableForeignKeys) {\n    batch.step().run(\"PRAGMA foreign_keys=on\");\n  }\n  await batch.execute();\n  const resultSets = [];\n  await beginPromise;\n  for (const stmtPromise of stmtPromises) {\n    const hranaRows = await stmtPromise;\n    if (hranaRows === undefined) {\n      throw new api_1.LibsqlError(\"Statement in a batch was not executed, probably because the transaction has been rolled back\", \"TRANSACTION_CLOSED\");\n    }\n    resultSets.push(resultSetFromHrana(hranaRows));\n  }\n  await commitPromise;\n  return resultSets;\n}\nexports.executeHranaBatch = executeHranaBatch;\nfunction stmtToHrana(stmt) {\n  if (typeof stmt === \"string\") {\n    return new hrana.Stmt(stmt);\n  }\n  const hranaStmt = new hrana.Stmt(stmt.sql);\n  if (Array.isArray(stmt.args)) {\n    hranaStmt.bindIndexes(stmt.args);\n  } else {\n    for (const [key, value] of Object.entries(stmt.args)) {\n      hranaStmt.bindName(key, value);\n    }\n  }\n  return hranaStmt;\n}\nexports.stmtToHrana = stmtToHrana;\nfunction resultSetFromHrana(hranaRows) {\n  const columns = hranaRows.columnNames.map(c => c ?? \"\");\n  const columnTypes = hranaRows.columnDecltypes.map(c => c ?? \"\");\n  const rows = hranaRows.rows;\n  const rowsAffected = hranaRows.affectedRowCount;\n  const lastInsertRowid = hranaRows.lastInsertRowid !== undefined ? hranaRows.lastInsertRowid : undefined;\n  return new util_1.ResultSetImpl(columns, columnTypes, rows, rowsAffected, lastInsertRowid);\n}\nexports.resultSetFromHrana = resultSetFromHrana;\nfunction mapHranaError(e) {\n  if (e instanceof hrana.ClientError) {\n    const code = mapHranaErrorCode(e);\n    return new api_1.LibsqlError(e.message, code, undefined, e);\n  }\n  return e;\n}\nexports.mapHranaError = mapHranaError;\nfunction mapHranaErrorCode(e) {\n  if (e instanceof hrana.ResponseError && e.code !== undefined) {\n    return e.code;\n  } else if (e instanceof hrana.ProtoError) {\n    return \"HRANA_PROTO_ERROR\";\n  } else if (e instanceof hrana.ClosedError) {\n    return e.cause instanceof hrana.ClientError ? mapHranaErrorCode(e.cause) : \"HRANA_CLOSED_ERROR\";\n  } else if (e instanceof hrana.WebSocketError) {\n    return \"HRANA_WEBSOCKET_ERROR\";\n  } else if (e instanceof hrana.HttpServerError) {\n    return \"SERVER_ERROR\";\n  } else if (e instanceof hrana.ProtocolVersionError) {\n    return \"PROTOCOL_VERSION_ERROR\";\n  } else if (e instanceof hrana.InternalError) {\n    return \"INTERNAL_ERROR\";\n  } else {\n    return \"UNKNOWN\";\n  }\n}","map":{"version":3,"names":["__createBinding","Object","create","o","m","k","k2","undefined","desc","getOwnPropertyDescriptor","__esModule","writable","configurable","enumerable","get","defineProperty","__setModuleDefault","v","value","__importStar","mod","result","prototype","hasOwnProperty","call","exports","mapHranaError","resultSetFromHrana","stmtToHrana","executeHranaBatch","HranaTransaction","hrana","require","api_1","util_1","mode","version","started","constructor","execute","stmt","batch","then","results","stmts","stream","_getStream","closed","LibsqlError","hranaStmts","map","rowsPromises","_getSqlCache","apply","beginStep","step","beginPromise","run","transactionModeToBegin","lastStep","hranaStmt","stmtStep","condition","BatchCond","ok","not","isAutocommit","rowsPromise","query","catch","e","close","resultSets","rows","push","executeMultiple","sql","sequence","rollback","promise","closeGracefully","commit","disableForeignKeys","stmtPromises","stmtPromise","commitStep","commitPromise","rollbackStep","_","hranaRows","Stmt","Array","isArray","args","bindIndexes","key","entries","bindName","columns","columnNames","c","columnTypes","columnDecltypes","rowsAffected","affectedRowCount","lastInsertRowid","ResultSetImpl","ClientError","code","mapHranaErrorCode","message","ResponseError","ProtoError","ClosedError","cause","WebSocketError","HttpServerError","ProtocolVersionError","InternalError"],"sources":["/Users/shoofle/Projects/the-forest/node_modules/@libsql/client/lib-cjs/hrana.js"],"sourcesContent":["\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    var desc = Object.getOwnPropertyDescriptor(m, k);\n    if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n      desc = { enumerable: true, get: function() { return m[k]; } };\n    }\n    Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n    Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n    o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n    if (mod && mod.__esModule) return mod;\n    var result = {};\n    if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n    __setModuleDefault(result, mod);\n    return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.mapHranaError = exports.resultSetFromHrana = exports.stmtToHrana = exports.executeHranaBatch = exports.HranaTransaction = void 0;\nconst hrana = __importStar(require(\"@libsql/hrana-client\"));\nconst api_1 = require(\"@libsql/core/api\");\nconst util_1 = require(\"@libsql/core/util\");\nclass HranaTransaction {\n    #mode;\n    #version;\n    // Promise that is resolved when the BEGIN statement completes, or `undefined` if we haven't executed the\n    // BEGIN statement yet.\n    #started;\n    /** @private */\n    constructor(mode, version) {\n        this.#mode = mode;\n        this.#version = version;\n        this.#started = undefined;\n    }\n    execute(stmt) {\n        return this.batch([stmt]).then((results) => results[0]);\n    }\n    async batch(stmts) {\n        const stream = this._getStream();\n        if (stream.closed) {\n            throw new api_1.LibsqlError(\"Cannot execute statements because the transaction is closed\", \"TRANSACTION_CLOSED\");\n        }\n        try {\n            const hranaStmts = stmts.map(stmtToHrana);\n            let rowsPromises;\n            if (this.#started === undefined) {\n                // The transaction hasn't started yet, so we need to send the BEGIN statement in a batch with\n                // `hranaStmts`.\n                this._getSqlCache().apply(hranaStmts);\n                const batch = stream.batch(this.#version >= 3);\n                const beginStep = batch.step();\n                const beginPromise = beginStep.run((0, util_1.transactionModeToBegin)(this.#mode));\n                // Execute the `hranaStmts` only if the BEGIN succeeded, to make sure that we don't execute it\n                // outside of a transaction.\n                let lastStep = beginStep;\n                rowsPromises = hranaStmts.map((hranaStmt) => {\n                    const stmtStep = batch\n                        .step()\n                        .condition(hrana.BatchCond.ok(lastStep));\n                    if (this.#version >= 3) {\n                        // If the Hrana version supports it, make sure that we are still in a transaction\n                        stmtStep.condition(hrana.BatchCond.not(hrana.BatchCond.isAutocommit(batch)));\n                    }\n                    const rowsPromise = stmtStep.query(hranaStmt);\n                    rowsPromise.catch(() => undefined); // silence Node warning\n                    lastStep = stmtStep;\n                    return rowsPromise;\n                });\n                // `this.#started` is resolved successfully only if the batch and the BEGIN statement inside\n                // of the batch are both successful.\n                this.#started = batch\n                    .execute()\n                    .then(() => beginPromise)\n                    .then(() => undefined);\n                try {\n                    await this.#started;\n                }\n                catch (e) {\n                    // If the BEGIN failed, the transaction is unusable and we must close it. However, if the\n                    // BEGIN suceeds and `hranaStmts` fail, the transaction is _not_ closed.\n                    this.close();\n                    throw e;\n                }\n            }\n            else {\n                if (this.#version < 3) {\n                    // The transaction has started, so we must wait until the BEGIN statement completed to make\n                    // sure that we don't execute `hranaStmts` outside of a transaction.\n                    await this.#started;\n                }\n                else {\n                    // The transaction has started, but we will use `hrana.BatchCond.isAutocommit()` to make\n                    // sure that we don't execute `hranaStmts` outside of a transaction, so we don't have to\n                    // wait for `this.#started`\n                }\n                this._getSqlCache().apply(hranaStmts);\n                const batch = stream.batch(this.#version >= 3);\n                let lastStep = undefined;\n                rowsPromises = hranaStmts.map((hranaStmt) => {\n                    const stmtStep = batch.step();\n                    if (lastStep !== undefined) {\n                        stmtStep.condition(hrana.BatchCond.ok(lastStep));\n                    }\n                    if (this.#version >= 3) {\n                        stmtStep.condition(hrana.BatchCond.not(hrana.BatchCond.isAutocommit(batch)));\n                    }\n                    const rowsPromise = stmtStep.query(hranaStmt);\n                    rowsPromise.catch(() => undefined); // silence Node warning\n                    lastStep = stmtStep;\n                    return rowsPromise;\n                });\n                await batch.execute();\n            }\n            const resultSets = [];\n            for (const rowsPromise of rowsPromises) {\n                const rows = await rowsPromise;\n                if (rows === undefined) {\n                    throw new api_1.LibsqlError(\"Statement in a transaction was not executed, \" +\n                        \"probably because the transaction has been rolled back\", \"TRANSACTION_CLOSED\");\n                }\n                resultSets.push(resultSetFromHrana(rows));\n            }\n            return resultSets;\n        }\n        catch (e) {\n            throw mapHranaError(e);\n        }\n    }\n    async executeMultiple(sql) {\n        const stream = this._getStream();\n        if (stream.closed) {\n            throw new api_1.LibsqlError(\"Cannot execute statements because the transaction is closed\", \"TRANSACTION_CLOSED\");\n        }\n        try {\n            if (this.#started === undefined) {\n                // If the transaction hasn't started yet, start it now\n                this.#started = stream\n                    .run((0, util_1.transactionModeToBegin)(this.#mode))\n                    .then(() => undefined);\n                try {\n                    await this.#started;\n                }\n                catch (e) {\n                    this.close();\n                    throw e;\n                }\n            }\n            else {\n                // Wait until the transaction has started\n                await this.#started;\n            }\n            await stream.sequence(sql);\n        }\n        catch (e) {\n            throw mapHranaError(e);\n        }\n    }\n    async rollback() {\n        try {\n            const stream = this._getStream();\n            if (stream.closed) {\n                return;\n            }\n            if (this.#started !== undefined) {\n                // We don't have to wait for the BEGIN statement to complete. If the BEGIN fails, we will\n                // execute a ROLLBACK outside of an active transaction, which should be harmless.\n            }\n            else {\n                // We did nothing in the transaction, so there is nothing to rollback.\n                return;\n            }\n            // Pipeline the ROLLBACK statement and the stream close.\n            const promise = stream.run(\"ROLLBACK\").catch((e) => {\n                throw mapHranaError(e);\n            });\n            stream.closeGracefully();\n            await promise;\n        }\n        catch (e) {\n            throw mapHranaError(e);\n        }\n        finally {\n            // `this.close()` may close the `hrana.Client`, which aborts all pending stream requests, so we\n            // must call it _after_ we receive the ROLLBACK response.\n            // Also note that the current stream should already be closed, but we need to call `this.close()`\n            // anyway, because it may need to do more cleanup.\n            this.close();\n        }\n    }\n    async commit() {\n        // (this method is analogous to `rollback()`)\n        try {\n            const stream = this._getStream();\n            if (stream.closed) {\n                throw new api_1.LibsqlError(\"Cannot commit the transaction because it is already closed\", \"TRANSACTION_CLOSED\");\n            }\n            if (this.#started !== undefined) {\n                // Make sure to execute the COMMIT only if the BEGIN was successful.\n                await this.#started;\n            }\n            else {\n                return;\n            }\n            const promise = stream.run(\"COMMIT\").catch((e) => {\n                throw mapHranaError(e);\n            });\n            stream.closeGracefully();\n            await promise;\n        }\n        catch (e) {\n            throw mapHranaError(e);\n        }\n        finally {\n            this.close();\n        }\n    }\n}\nexports.HranaTransaction = HranaTransaction;\nasync function executeHranaBatch(mode, version, batch, hranaStmts, disableForeignKeys = false) {\n    if (disableForeignKeys) {\n        batch.step().run(\"PRAGMA foreign_keys=off\");\n    }\n    const beginStep = batch.step();\n    const beginPromise = beginStep.run((0, util_1.transactionModeToBegin)(mode));\n    let lastStep = beginStep;\n    const stmtPromises = hranaStmts.map((hranaStmt) => {\n        const stmtStep = batch.step().condition(hrana.BatchCond.ok(lastStep));\n        if (version >= 3) {\n            stmtStep.condition(hrana.BatchCond.not(hrana.BatchCond.isAutocommit(batch)));\n        }\n        const stmtPromise = stmtStep.query(hranaStmt);\n        lastStep = stmtStep;\n        return stmtPromise;\n    });\n    const commitStep = batch.step().condition(hrana.BatchCond.ok(lastStep));\n    if (version >= 3) {\n        commitStep.condition(hrana.BatchCond.not(hrana.BatchCond.isAutocommit(batch)));\n    }\n    const commitPromise = commitStep.run(\"COMMIT\");\n    const rollbackStep = batch\n        .step()\n        .condition(hrana.BatchCond.not(hrana.BatchCond.ok(commitStep)));\n    rollbackStep.run(\"ROLLBACK\").catch((_) => undefined);\n    if (disableForeignKeys) {\n        batch.step().run(\"PRAGMA foreign_keys=on\");\n    }\n    await batch.execute();\n    const resultSets = [];\n    await beginPromise;\n    for (const stmtPromise of stmtPromises) {\n        const hranaRows = await stmtPromise;\n        if (hranaRows === undefined) {\n            throw new api_1.LibsqlError(\"Statement in a batch was not executed, probably because the transaction has been rolled back\", \"TRANSACTION_CLOSED\");\n        }\n        resultSets.push(resultSetFromHrana(hranaRows));\n    }\n    await commitPromise;\n    return resultSets;\n}\nexports.executeHranaBatch = executeHranaBatch;\nfunction stmtToHrana(stmt) {\n    if (typeof stmt === \"string\") {\n        return new hrana.Stmt(stmt);\n    }\n    const hranaStmt = new hrana.Stmt(stmt.sql);\n    if (Array.isArray(stmt.args)) {\n        hranaStmt.bindIndexes(stmt.args);\n    }\n    else {\n        for (const [key, value] of Object.entries(stmt.args)) {\n            hranaStmt.bindName(key, value);\n        }\n    }\n    return hranaStmt;\n}\nexports.stmtToHrana = stmtToHrana;\nfunction resultSetFromHrana(hranaRows) {\n    const columns = hranaRows.columnNames.map((c) => c ?? \"\");\n    const columnTypes = hranaRows.columnDecltypes.map((c) => c ?? \"\");\n    const rows = hranaRows.rows;\n    const rowsAffected = hranaRows.affectedRowCount;\n    const lastInsertRowid = hranaRows.lastInsertRowid !== undefined\n        ? hranaRows.lastInsertRowid\n        : undefined;\n    return new util_1.ResultSetImpl(columns, columnTypes, rows, rowsAffected, lastInsertRowid);\n}\nexports.resultSetFromHrana = resultSetFromHrana;\nfunction mapHranaError(e) {\n    if (e instanceof hrana.ClientError) {\n        const code = mapHranaErrorCode(e);\n        return new api_1.LibsqlError(e.message, code, undefined, e);\n    }\n    return e;\n}\nexports.mapHranaError = mapHranaError;\nfunction mapHranaErrorCode(e) {\n    if (e instanceof hrana.ResponseError && e.code !== undefined) {\n        return e.code;\n    }\n    else if (e instanceof hrana.ProtoError) {\n        return \"HRANA_PROTO_ERROR\";\n    }\n    else if (e instanceof hrana.ClosedError) {\n        return e.cause instanceof hrana.ClientError\n            ? mapHranaErrorCode(e.cause)\n            : \"HRANA_CLOSED_ERROR\";\n    }\n    else if (e instanceof hrana.WebSocketError) {\n        return \"HRANA_WEBSOCKET_ERROR\";\n    }\n    else if (e instanceof hrana.HttpServerError) {\n        return \"SERVER_ERROR\";\n    }\n    else if (e instanceof hrana.ProtocolVersionError) {\n        return \"PROTOCOL_VERSION_ERROR\";\n    }\n    else if (e instanceof hrana.InternalError) {\n        return \"INTERNAL_ERROR\";\n    }\n    else {\n        return \"UNKNOWN\";\n    }\n}\n"],"mappings":"AAAA,YAAY;;AACZ,IAA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